You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code is working completely right.
#include <stdio.h>
char* slice(char str[], int m, int n){
str = &str[m];
str[n-m+1] = '\0';
return str;
}
int main(){
char str[] = "Himanshu Srivastav";
int m = 6;
int n = 11;
printf("%s\n", slice(str, 6, 11));
return 0;
}
Hope this will implemented soon.
srivastavHimanshu4503
changed the title
The following code does not work as intended.
The following code does not work as intended. Chapter 8-Practice Set Question Number 4
Jul 15, 2024
#include <stdio.h>
char* slice(char str[], int m, int n){
int i=0, count;
char *ptr1 = &str[m];
char *ptr2 = &str[n];
}
int main(){
char str[] = "Himanshu Srivastav";
}
The text was updated successfully, but these errors were encountered: