putchar
Confused about "while(getchar() != '\n')"
I knew that getchar() is just a function gets the first character of the line the user entered then the next and so on[详细]
2023-04-04 09:20 分类:问答Is getchar() equivalent to scanf("%c") and putchar() equivalent to printf("%c")?
Is a = getchar开发者_如何学JAVA() equivalent to scanf(\"%c\",&a);? Is putchar(a) equivalent to printf(\"%c\",a); where a is a char variable?Generally speaking yes they are the same.[详细]
2022-12-24 14:56 分类:问答getchar() and putchar()
in the example: #include <stdio.h> main() { long nc; nc = 0; while (getchar() != EOF) ++nc; printf(\"%ld\\n\", nc);[详细]
2022-12-19 03:44 分类:问答Opposite of putchar()?
Is there an opposite to putchar() where you can pass the ascii character and it will output the numerical valu开发者_如何学编程e?Thanks.printf(\"%d\\n\", c);I am not sure which language you are talkin[详细]
2022-12-16 09:30 分类:问答