Problem Analysis
Per the signature
void new_student(char *name, int ID)
the 1st argument must be char *
.
However according to the call
new_student((string_split_string(inputc1),(string_split_int(inputc1)));
/*<----the warning points here*/
and the per signature
char string_split_string(char input_string[]);
the type returned by string_split_string()
and thus the 1st argument to new_student()
is char
.
In short, the caller is providing char
where callee requires char *
.
Solution Sketch
Splitting a string is a fairly common task, please take some to (re)search on that, before rolling out a complex solution.
C
C++
Look at the
std::string
and its member functions for example std::string::find()Look at Split a string in C++?