Previous Thread
Next Thread
Print Thread
Rate Thread
#17247 09/25/02 08:47 PM
Joined: Mar 1983
Posts: 55
S
UGN Elder
UGN Elder
S Offline
Joined: Mar 1983
Posts: 55
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
▼ Sponsored Links ▼ ▲ Sponsored Links ▲
#17248 09/26/02 06:11 AM
Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
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/29/02 08:34 PM
Joined: Mar 1983
Posts: 55
S
UGN Elder
UGN Elder
S Offline
Joined: Mar 1983
Posts: 55
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

Link Copied to Clipboard
Member Spotlight
None yet
Forum Statistics
Forums41
Topics33,840
Posts68,858
Members2,176
Most Online3,253
Jan 13th, 2020
Latest Postings
Top Posters
UGN Security 41,392
Gremelin 7,203
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Likes Received
Ghost 2
Ice 1
Dartur 1
Cyrez 1
Girlie 1
unreal 1
Powered by UBB.threads™ PHP Forum Software 8.0.0