Question: #include #define MAX_STR_LEN 2048 Need help with writing a C program. Need to write a function void stringLength(char *str, int *len) that can give the

#include #define MAX_STR_LEN 2048

Need help with writing a C program. Need to write a function void stringLength(char *str, int *len) that can give the length of a string

Part of the main() code is given: int main() { char string1[MAX_STR_LEN]="To see a world in a grain of sand,"; char string2[MAX_STR_LEN]="And a heaven in a wild flower."; int len1,len2; len1=0; len2=0; printf("%s ",string1); printf("%s ",string2); printf("String 1 is %d characters long ",len1); printf("String 2 is %d characters long ",len2); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!