We have a function like this:
And we need to ask the user for an integer input and then append it. So I have:
void DS_append(DynString ds, char *newtxt)
But when I compile it gives me:
printf("Please enter a number: ");
DS_append(ds, x); // This is line 29
And when I run it, of course, the much dreaded...
ex5.c:29: warning: passing argument 2 of ‘DS_append’ makes pointer from integer without a cast
I've tried every combination of
DS_append(ds, (char) x);
DS_append(ds, (char *) x);
DS_append(ds, (char *) &x);
But none seem to work.
Can anyone figure out what I'm doing wrong here?