| Tekststrenge - slide 25 : 26 |
Input af teststrenge med scanf har specielle regler
Output af tekststrenge med printf virker som forventet
#include <stdio.h>
#include <string.h>
int main(void) {
char input[100];
do {
printf("Enter a string: ");
scanf("%s", input);
printf("You entered \"%s\"\n", input);
} while (strcmp(input, "exit"));
return 0;
}






