Answer to Question #3819 in C++ for Antuan
How can I get user input in c++ to pass to a function that accepts char*? ie addRecord(char* lName, char* fName, char grade)
1
2011-08-04T05:50:51-0400
#include <iostream>using namespace std;
void addRecord(char* lName, char* fName, char grade){
// addRecord method body
}
int main(int argc, char** argv)
{
char lName[20];
char fName[20];
char grade;
cout << "Enter 'lName'" << endl;
cin >> lName;
cout << "Enter 'fName'" << endl;
cin >> fName;
cout << "Enter 'grade'" << endl;
cin >> grade;
cout << lName;
addRecord(lName, fName, grade);
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment