I use a while loop with the function fgets() but it adds the /n at the end and when it's in the combo box, the /n is a weird char.
What do you think is the best way to do this.
I use a while loop with the function fgets() but it adds the /n at the end and when it's in the combo box, the /n is a weird char.
What do you think is the best way to do this.
in windows edit boxes, the newline character is actually read as: \r\n, so that should fix your problem
Originally Posted by Dante Shamest
I can do this but I will have to use more lines of code, are there any shorter ways.
You should only need a few more lines. For example, if line is the C-style string,I can do this but I will have to use more lines of code, are there any shorter ways.
Code:int iNewLine = strlen( line ) - 1 ; // "\n" is stored at the end line[ iNewLine ] = 0 ; // replace with 0
Thanks Dante for doing the work for me, hehe. All I did was cut and paste your code and rename the variables and it works.