ReadFile problem

example 1: 32767*32767*32767*32767
Now if send 24 chars and read them in "UitBuff"(24 chars) the data is correct.

However if i send less then 24 chars and still try to read 24 chars the data is not always correct.

example 2: if i try to send: 33*32767*57*4231* (17 chars)
I sometimes get values like "3*32767*57*4231**2"
Now i know that values behind the the 17th char can be anything but the values like "33" in de beginning is now "3". Can anyone explain to me why?
Also if i change UitBuff to 17 chars and nNumberOfBytesToRead to 17 instead of 24 the data is always correct.

So the problem is if i send 17 and try to read 24 chars i dont always get the the correct data. Can anyone help me out here??

If you have a receive buffer which always reads 24 chars, and you're going to send less than 24 chars, be sure to send a 'end of string' character which is a '\0' .

Tried this but does not seem to work.....

Also a good idea: Use English variable names and comments instead of Dutch. Not everyone here can read Dutch.

Hmmm yeah ur right!ill do that next time!

However i found sort of an solution..
I changed my code in the atmega328 it now always sends 24 chars.
so if i wanted to send this 33*32767*57*4231*
ill now add zero's to "33", "57" and "4231" so i will get 00033*32767*00057*04231*.

Okey , this is what happends , when I write in my code and compile it this error shows up. [URL="http://data.fuskbugg.se/dipdip/Problem%20med%20c%2B%2B%20script.jpg"]http://data.fuskbugg.se/dipdip/Problem%20med%20c%2B%2B%20script.jpg[/URL]
And after recieving this …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...