Help with C Programming using getchar() line please?!

Techie333

Platinum Member
Jan 20, 2001
2,368
0
0
Hi guys. I am writing a program for class and there is one thing I just can't figure out. I have to write a program that reads input until encountering #. Then it prints each character and the ASCII decimal code. The problem is that I can do the whole enter input until # is entered using getchar, but the how do I return each INDIVIDUAL character!??! Thanks!
 

BigJ

Lifer
Nov 18, 2001
21,330
1
81
This is the reason why Programming will never get split off from Software. Because nobody will post in the right god damn forum anyway.
 

Techie333

Platinum Member
Jan 20, 2001
2,368
0
0
a user input...this code i am using to get the input:

while ((ch = getchar ()) != '#')
 

BigJ

Lifer
Nov 18, 2001
21,330
1
81
Originally posted by: Techie333
Looks its 1AM and my programs are due by 8am. Will you guys please just help me out?

If you posted in the Software- Etc. forum, you could actually upload the code and show people your specific problem, and what you've actually tried to do.
 

BigJ

Lifer
Nov 18, 2001
21,330
1
81
Originally posted by: JoeKing
you're not very techie are you?

Look at his post in Software. He has *NOTHING* and is just looking for some an easy answer so he doesn't fail.
 

Techie333

Platinum Member
Jan 20, 2001
2,368
0
0
Originally posted by: BigJ
Originally posted by: JoeKing
you're not very techie are you?

Look at his post in Software. He has *NOTHING* and is just looking for some an easy answer so he doesn't fail.
You are a moron! I can't get any further in the program until I figure this out!

 

BigJ

Lifer
Nov 18, 2001
21,330
1
81
Originally posted by: Techie333
Originally posted by: BigJ
Originally posted by: JoeKing
you're not very techie are you?

Look at his post in Software. He has *NOTHING* and is just looking for some an easy answer so he doesn't fail.
You are a moron! I can't get any further in the program until I figure this out!

I'm the moron? I'm not the one that's about to fail an Intro level programming class. Neither did I wait until 6.5 hours until the fvcking program was due (yes my clock is fast so I'm early to work). Moron.
 

EvilYoda

Lifer
Apr 1, 2001
21,198
9
81
Originally posted by: BigJ
Originally posted by: Techie333
Originally posted by: BigJ
Originally posted by: JoeKing
you're not very techie are you?

Look at his post in Software. He has *NOTHING* and is just looking for some an easy answer so he doesn't fail.
You are a moron! I can't get any further in the program until I figure this out!

I'm the moron? I'm not the one that's about to fail an Intro level programming class. Neither did I wait until 6.5 hours until the fvcking program was due. Moron.

You guys are funny.

moron. (everybody else is saying it...)
 

BigJ

Lifer
Nov 18, 2001
21,330
1
81
Originally posted by: EvilYoda

You guys are funny.

moron. (everybody else is saying it...)

That doesn't mean much coming from an alien/Yoda hybrid!