0

how do i add a space character when storing an input string in a 2d array in c?

this is my code: #include<stdio.h> int main() { char names[20][20]; scanf("%s",names[1]); printf("^%s",names[1]); return 0; } should i use scanf with [^\n] ? or other code?

15th Jan 2022, 1:21 PM
Rey Vincent Ocero
Rey Vincent Ocero - avatar
1 Resposta