Hi there, I’m currently writing a piece of software that will take an input from a user terminal and then sends it to another process using a memory mapped file. Well that’s all coded and I though that would be the hard part.
However I’m having problems with the user input, I’m just using a basic cin >> statement and if the user types in
“hello world”
Then program thinks that’s 2 arguments and will send “hello” then “world” to the other process.
Is there away to get the program to read in the command prompt line as one single zero terminated string?
Here is the basic code im using
Code:
while(loop != 1){
cout << "Please enter the detials you want to add to the list\n";
cin >> userInput;
strcpy(SharedVirtualMemory2, userInput);
sleep(1000);
}
Edit:
If you have VS.Net installed then i have attached the full project in .rar format, the code is very well commented and my problem is in UserProducer.cpp.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.