E
Eirik WS
I have a function(whose code I have stolen from one of you
in comp.lang.c):
void myStringClean(char *String) {
char *pointer;
if((pointer = strchr(String, '\n')) != NULL) {
*pointer = '\0';
}
}
How should I call this function? I've called like this in main.c:
myStringClean(myName);
I get no errors or warnings when I call
the function like this with
gcc -ansi -pedantic -Wall -W,
when I call it using
myStringClean(&myName);
I get the warnings
passing arg 1 of 'myStringClean' from incompatible pointer type.
The prototype in mSC.h looks like this:
#include <string.h>
void myStringClean(char *String);
In advance thanks for helpful replies.
in comp.lang.c):
void myStringClean(char *String) {
char *pointer;
if((pointer = strchr(String, '\n')) != NULL) {
*pointer = '\0';
}
}
How should I call this function? I've called like this in main.c:
myStringClean(myName);
I get no errors or warnings when I call
the function like this with
gcc -ansi -pedantic -Wall -W,
when I call it using
myStringClean(&myName);
I get the warnings
passing arg 1 of 'myStringClean' from incompatible pointer type.
The prototype in mSC.h looks like this:
#include <string.h>
void myStringClean(char *String);
In advance thanks for helpful replies.