CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Mar 2005
    Posts
    2

    Multiple String Inputs

    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.

    Cheers for any help in advance.
    Ross
    Attached Files Attached Files
    Last edited by Rue; March 11th, 2005 at 01:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured