#include<stdio.h> main() { char str[100]; printf("Enter a string\n"); scanf("%[^\n]",str); int i=0; for(;str[i];i++); printf("Length is %d\n",i); }
include <stdio.h> int main() { char str[100]; printf("Enter a string: "); printf( "\rLength is: %d", printf("Entered string is: %s\n", gets(str)) - 20); return 0; }
Consider an implementation of Strings consisting of an array where the first element of the array indicates the length of the String and the next elements represent the value of the ASCII characters in the String. Implement String concatenation of such scenario using C?