I get this error,
cannot convert parameter 1 from 'unsigned char' to 'char
*'

when I do
strcpy(logout,"Log File opened.\r\n");

logout is defined as
unsigned char logout;

What do I need to do to resolve this? I'm just learning
C++ so I need help getting into the right direction with
this.

Thanks.

Re: char error message by CheckAbdoul

CheckAbdoul
Wed Jul 30 13:28:52 CDT 2003

Hi Sean,
You can store only a single character in a variable of type
'unsigned char'. Since you are trying to copy more than a single character,
you need to redefine your variable type to a char array. Try the following


unsigned char logout[MAX_PATH] = {0};
strcpy(logout,"Log File opened.\r\n");

--
Cheers
Check Abdoul [ VC++ MVP ]
-----------------------------------

"Sean Whitesell" <seanw@vigoris.net> wrote in message
news:003601c356c2$f6409e60$a601280a@phx.gbl...
> I get this error,
> cannot convert parameter 1 from 'unsigned char' to 'char
> *'
>
> when I do
> strcpy(logout,"Log File opened.\r\n");
>
> logout is defined as
> unsigned char logout;
>
> What do I need to do to resolve this? I'm just learning
> C++ so I need help getting into the right direction with
> this.
>
> Thanks.



Re: char error message by Bo

Bo
Wed Jul 30 15:05:08 CDT 2003


"CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267>
skrev i meddelandet news:uhc6ZhsVDHA.1280@tk2msftngp13.phx.gbl...
> Hi Sean,
> You can store only a single character in a variable of type
> 'unsigned char'. Since you are trying to copy more than a single
character,
> you need to redefine your variable type to a char array. Try the
following
>
>
> unsigned char logout[MAX_PATH] = {0};
> strcpy(logout,"Log File opened.\r\n");
>
> --
> Cheers
> Check Abdoul [ VC++ MVP ]
> -----------------------------------
>
> "Sean Whitesell" <seanw@vigoris.net> wrote in message
> news:003601c356c2$f6409e60$a601280a@phx.gbl...
> > I get this error,
> > cannot convert parameter 1 from 'unsigned char' to 'char
> > *'
> >
> > when I do
> > strcpy(logout,"Log File opened.\r\n");
> >
> > logout is defined as
> > unsigned char logout;

It is also *extremely* unusual to use signed or unsigned char instead
of just plain char. Consider if you really have a special reason for
doing so.


Bo Persson
bop2@telia.com


> >
> > What do I need to do to resolve this? I'm just learning
> > C++ so I need help getting into the right direction with
> > this.
> >
> > Thanks.
>
>