For this line: (assuming you make the above fix...)
You are copying a string (char array) into a char. Bad idea. Fix it.Code:strcat(lineh,line);//append line to accomodate lineh
For this line: (assuming you make the above fix...)
You are copying a string (char array) into a char. Bad idea. Fix it.Code:strcat(lineh,line);//append line to accomodate lineh
Mainframe assembler programmer by trade. C coder when I can.
For this warning:
You are trying to assign a pointer to an int array to a 1 byte char. Bad idea. Fix it.Code:lineh = linea;
Mainframe assembler programmer by trade. C coder when I can.
I have some ideas but i want to be perfectly clear that there is a way to fix this without rewriting the entire code.
Is that a question? There's a lot of little mistakes, so although you probably don't have to start from scratch, I would definitely go through line by line, and confirm that every line actually does what you think it does when you execute it.I have some ideas but i want to be perfectly clear that there is a way to fix this without rewriting the entire code.
Yeah, read this A development process
Then rewrite the code in much smaller steps, compiling and testing as you go.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.