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


Messages In This Thread
Working with strings in C - by Qomplainerz - 07-25-2023, 11:40 AM

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

Forum Jump:


Users browsing this thread: 2 Guest(s)