visual c++ - How to cin data to store in a struct defined in another header file? -
I am working on my homework and got trapped in this place. If someone can help me with this then this would be useful. I am using Visual C ++.
This is a header file with a square.
#ifndef CALLER_H #define CALLER_H #include & lt; String & gt; # Include & lt; Time.h> # Include "NodeData H" using the namespace std; Class caller {Private: int phone_number; Zero setphone number () {int min = 300000; Int max = 800000; Phone_number = minutes + rand ()% (max-min + 1); } String callers_name; String message; }; #endif
I'm trying to store the name and message string in the header file above but I'm getting the error I searched on Google and it was a possible solution: " Cin >> caller.callers_name; " But the error is still happening "cin >> caller.message;" Is similar to.
int _tmain (int argc, _TCHAR * argv []) {queueList L; Collar * collar = faucet; Int likes; Const int columnSize = 3; String columnname [columnSize]; Cout & lt; & Lt; "\ N \ t \ tanz call center simulation \ n"; Cout & lt; & Lt; "\ N \ tTo call by the caller 1, press. \ N"; Cout & lt; & Lt; "Press 2 to receive a call by a consultant. \ N"; Cout & lt; & Lt; "\ TPress \ t to print all the callers. \ N \ t Options:"; Cin & gt; & Gt; the option; If (like == 1) {cout & lt; & Lt; "\ N \ tPlease leave your name and message. \ N"; Cout & lt; & Lt; "\ TEnter name:"; Cin & gt; & Gt; Caller.callers_name; Cout & lt; & Lt; "\ N \ t Message:"; Cin & gt; & Gt; Caller.message; } And if (likes == 2) {} .............. system ("pause"); Return 0; }
Comments
Post a Comment