Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I'm trying to make an old C console program work in Visual C++. It's a program that uses file processing to a binary file.
I use this struct:
When I use the gets() function in my console program I can take whatever the user input to a char buffer. With this I can save any type of character in my database.
But in VC++ 6, I'm using an edit box with CString. If I take the contents of the edit box and use strcpy() to copy the CString to the
char array in a Sample struct things go wrong. The program doesn't complain but something goes wrong in adding this struct to the data file. When added the word can't be found.
It's alright as long as I don't use digits and odd characters.
How can I get the text in the editbox without any changes to a char array? If the user inputs Name as: bill12_e()/&%_- then I would like that exact name to be in the data file.
0 · ·