I knew that getchar() is just a function gets the first character of the line the user entered then the next and so on
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.
in the example: #include <stdio.h> main() { long nc; nc = 0; while (getchar() != EOF) ++nc; printf(\"%ld\\n\", nc);
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