Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

beginner: strange characters returned from array search

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am a beginner and have written some code that searches an array with three rows. it searches for a number and returns a charcter from the array, if there is no entry it returns an *. it works fine for every number i enter except 1 to 6 which return various symbols including a diamond, heart, spade and a couple of smiley faces. can anyone tell me why this is happening.
 
just a guess, but maybe it is treating the 1-6 as ascii values but then again, why would it not happen for 7-9 and 0?

Try memset on your buffer and set it all to zero

memset(buffer,0,BUFFER_SIZE);


Matt
 
problem was a simple stupid thing i did. the array had ten columns but the search was searching through 100 columns. one too many 0 was the cause of all the problems. lesson learnt: go through code with fine tooth comb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top