QP School
Working with strings in C - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: C 18 Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=32)
+--- Thread: Working with strings in C (/showthread.php?tid=5090)



Working with strings in C - Qomplainerz - 07-25-2023

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);