Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working with strings in C
#1
Strings are arrays of characters.
char name[] = "John";
printf("Name: %s\n", name); // Output: John

// String input using scanf()
char city[50];
printf("Enter your city: ");
scanf("%s", city);
printf("City: %s\n", city);
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Working with floats from user input in C Qomplainerz 0 358 07-26-2023, 08:23 AM
Last Post: Qomplainerz
  Working with integers from user input in C Qomplainerz 0 377 07-26-2023, 08:19 AM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 5 Guest(s)