HELP, I am having problems with pointer... 
Author Message
 HELP, I am having problems with pointer...

Folks,

I am working on learning C and am pulling my hair out over this one.  For some
reason I getting two warnings:

Nonportable pointer conversion in function Split
Possibly incorrect assignment in function Split

I have NO idea why!  This is an OS/2 code so PCHAR is char * and USHORT is a
short int.  Here is the part that is bothing me:

CHAR *Split(PCHAR pchr, PCHAR end)
{
        PCHAR path;
        USHORT  i;

        for(i=0;pchr[i];i++) pchr[i] = toupper (pchr[i]);
        for(i=0; end[i];i++)  end[i] = toupper ( end[i]);

        path = strstr( pchr, end );

        if( path ) {  <<<< this is the pointer that isn't working
                           and is giving me the error!

Thanks a million for the help:)

Sam

P.S.  please E-Mail responces:)



Tue, 10 Dec 1996 11:07:34 GMT  
 HELP, I am having problems with pointer...

Quote:
>I am working on learning C and am pulling my hair out over this one.  For some
>reason I getting two warnings:

>Nonportable pointer conversion in function Split
>Possibly incorrect assignment in function Split

>    PCHAR path;

>    if( path ) {  <<<< this is the pointer that isn't working
>                           and is giving me the error!

Your compiler is brain damaged. Ignore the warnings.

Dan
--
Dan Pop
CERN, CN Division

Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland



Tue, 10 Dec 1996 15:29:11 GMT  
 HELP, I am having problems with pointer...

Quote:

>Nonportable pointer conversion in function Split
>Possibly incorrect assignment in function Split
>>        PCHAR path;
>    path = strstr( pchr, end );

>    if( path ) {  <<<< this is the pointer that isn't working
>                           and is giving me the error!

        Are you sure it's not the "path = strstr( pchr, end );"
        line that's giving you the warning?  Try including
        string.h...

---




Tue, 10 Dec 1996 23:01:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. I am having problems setting up that a specified dialog is displayed before any others

2. I am having problems with MFC42.dll file

3. I am having probability difficulties...HELP

4. Having problems converting help files to html help.

5. i am unable to read from a file having 26ascii character(ctrl+z)

6. I am having with my bishop

7. I am having troubles with the switch()

8. I am having probability d

9. Please help-still having problems with bubble sort

10. HELP, having problems with floating point math.

11. I keep having problems with * operator, please help!

12. Raw beginner having problems - please help

 

 
Powered by phpBB® Forum Software