String access operations

String library functions.

 Assign the size of userInput to stringSize. Ex: if userInput = “Hello”, output is:

 

Size of userInput: 5
#include <stdio.h>
#include <string.h>

int main(void) {
 char userInput[50] = "";
 int stringSize = 0;

strcpy(userInput, "Hello");

stringSize =strlen(userInput);

printf("Size of userInput: %d\n", stringSize);

return 0;
}