Thread: Using MC++ How do you pass a String between forms?

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    8

    Using MC++ How do you pass a String between forms?

    I have been trying to pass a string from form2 to form1. form1 then displays the string.
    I have a button on form1 that creats an instance of form2. form2 asks for the user input and sends it back to form1. However i am not sure how to pass from form2 back to form1. Tried using public variables but that did not work. Any suggestions or online tutorials would help. Thanks

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    Code:
    void form1(void){
      char achIn[100];
      form2(achIn);
    }
    
    char *form2(char *inStr){
      strcpy(inStr, "input");
      return(inStr);
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please check my C++
    By csonx_p in forum C++ Programming
    Replies: 263
    Last Post: 07-24-2008, 09:20 AM
  2. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 12:56 PM
  3. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  4. creating class, and linking files
    By JCK in forum C++ Programming
    Replies: 12
    Last Post: 12-08-2002, 02:45 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM