I declared WORDP1 as

char WORDP1[20];

So you mean something like this does not compile without an error/warning?

#include <stdio.h>
#include <string.h>

int main(void) {
    char mystring[] = "this is a test.\n";
    char *p = strchr(mystring, '\n');
    if (p != NULL) *p = '\0';
    printf("%s no newlines should occur.\n", mystring);

If so, maybe you should check your compiler/warning settings. That is standard code and compiles fine for me under gcc.

This is the warning:

"wordlink_options.c", line 75.7: 1506-068 (W) Operation between types "unsigned char*" and "int" is not allowed.

and the code is:

char *p;

Did you #include <string.h> ?

Really, you could avoid 20 questions by posting a minimal snippet of actual code, such as joeprogrammer has done, and get an answer much quicker.

thanks !!!.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.