I have main function like this:
void main()
{
char *s;
inputString(s);
printf("%s",s);
}
and inputString function:
void inputString(char *&s)
{
//Some code line to input a string and set s point to this string
}
Is there have a function auto malloc memory enough store string which inputed (I need input string in inputString function).
You’re mixing C and C++ in your example.
In your case before you can use s it should be initialized. For example, like this:
But really, then it’s better to just use plain old C: