Your browser does not seem to support CSS. If images appear below, please disregard them.
It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a Donation to help aid in operating costs.
Previous Thread
Next Thread
Print Thread
Rate This Thread
#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
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
#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

Member Spotlight
Gremelin
Gremelin
Portland, OR; USA
Posts: 7,197
Joined: February 2002
Show All Member Profiles 
Forum Statistics
Forums45
Topics33,757
Posts68,899
Average Daily Posts2
Members2,159
Most Online1,567
Apr 25th, 2010
Latest Postings
Blackbeard.....
by Gremelin on 01/14/17 07:03 PM
Top Posters(All Time)
UGN Security 40,890
Gremelin 7,197
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Liked Users (All Time)
§intå× Likes: 3
Black Beard Likes: 1
Cold Sunn Likes: 1
Crime Likes: 1
Cyrez Likes: 1
fleshwound Likes: 1
Ghost Likes: 2
Gremelin Likes: 12
Ice Likes: 1
ninjaneo Likes: 1
Top Liked Users (30 Days)
No Data Found
Powered by UBB.threads™ PHP Forum Software 7.6.0
(Snapshot build 20160902)