Your browser does not seem to support CSS. If images appear below, please disregard them.
toggle
May
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Sponsored Links
Latest Postings
Topic Options
Rate This Topic
#17247 - 09/26/02 03:47 AM Input buffer
Joined: Mar 1983
Posts: 55
Skull Offline
UGN Elder
Skull Offline
UGN Elder

Joined: Mar 1983
Posts: 55
Iowa
I am trying to make a program in C but am running into problems with my input buffer storing characters that i dont want it to store. Is their a simple way to wipe this buffer clean every time i run though the loop i have it going through?

Regards,

Skull


Trust me, if i started killing people, there'd None of you left
Top
Sponsored Links
#17248 - 09/26/02 01:11 PM Re: Input buffer
Joined: Mar 2002
Posts: 1,273
SilentRage Offline
DollarDNS Owner
SilentRage Offline
DollarDNS Owner

Joined: Mar 2002
Posts: 1,273
OH, USA
yeah, I had a problem with that in my buffer in my telnet router program. Here's what I did:

ZeroMemory(&buffer[0], 4096);

Full code found at:
ftp://serialcoders.sytes.net/Router/TelnetRouter_v3.0.zip


Domain Registration, Hosting, Management
http://www.dollardns.net
Top
#17249 - 09/30/02 03:34 AM Re: Input buffer
Joined: Mar 1983
Posts: 55
Skull Offline
UGN Elder
Skull Offline
UGN Elder

Joined: Mar 1983
Posts: 55
Iowa
Thanks Mr. Rage

An Alternitvie solution that i found is the setbuf(); function in conjuncture with the fflush() funcition. The set buf allows you to use a user defined var as your inputbuffer with a size that you spefify. Then using the fflush() it will flush that buffer retruning the null character to the first slot.

Regards,

Skull


Trust me, if i started killing people, there'd None of you left
Top

Member Spotlight
Gremelin

Gremelin
Portland, OR; USA
Posts: 7,194
Joined: February 2002
Show All Member Profiles 
Forum Statistics
Forums46
Topics45,730
Posts80,898
Members2,157
Most Online1,567
Apr 25th, 2010
Top Posters(All Time)
UGN Security 38,893
Gremelin 7,194
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Newest Members
Herbert_Sherbert, codemauve, Lillysdragon1984, Brewwit, boa
2157 Registered Users
Who's Online Now
1 registered members (Cyrez), 3 guests and 1 spider.
Latest News