...

putchar

Xiang
03-04-2003, 03:21 PM
Dear sir,

How to use the "putchar" in the string. Can you give me an example and define it.

Thanks

Xiang

Phantom
03-04-2003, 10:47 PM
Syntax:
#include <stdio.h>
int putchar(int c);

c is the numeric value of a character (65 is 'A' for example). It prints out the character by the numeric value.

#include <stdio.h>
main() {
putchar(65);
putchar(66);
}

Would output

A
B

Josh Campbell
03-04-2003, 10:54 PM
or you could just say putchar('A'); putchar('B'); to make it easier.

Phantom
03-05-2003, 12:17 AM
Pretty much, but the numbers make you look smarter (and, of course, geekier :() :cool:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum