Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-04-2003, 03:21 PM   PM User | #1
Xiang
New Coder

 
Join Date: Jul 2002
Location: Malaysia
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Xiang is an unknown quantity at this point
putchar

Dear sir,

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

Thanks

Xiang
Xiang is offline   Reply With Quote
Old 03-04-2003, 10:47 PM   PM User | #2
Phantom
Regular Coder

 
Join Date: Feb 2003
Location: East Side/West Side
Posts: 118
Thanks: 0
Thanked 0 Times in 0 Posts
Phantom is an unknown quantity at this point
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
Phantom is offline   Reply With Quote
Old 03-04-2003, 10:54 PM   PM User | #3
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
or you could just say putchar('A'); putchar('B'); to make it easier.
Josh Campbell is offline   Reply With Quote
Old 03-05-2003, 12:17 AM   PM User | #4
Phantom
Regular Coder

 
Join Date: Feb 2003
Location: East Side/West Side
Posts: 118
Thanks: 0
Thanked 0 Times in 0 Posts
Phantom is an unknown quantity at this point
Pretty much, but the numbers make you look smarter (and, of course, geekier )
Phantom is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:42 AM.


Advertisement
Log in to turn off these ads.