Re: [C] simple string question
From: AirPete (x_at_x.x)
Date: 02/05/04
- Next message: James Connell: "Re: api call from c++"
- Previous message: Ben Measures: "Re: api call from c++"
- In reply to: Alan: "[C] simple string question"
- Next in thread: Alan: "Re: [C] simple string question"
- Reply: Alan: "Re: [C] simple string question"
- Reply: Leor Zolman: "Re: [C] simple string question"
- Reply: E. Robert Tisdale: "Re: [C] simple string question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 05 Feb 2004 03:15:29 GMT
Alan wrote:
> hi all,
>
> I want to define a constant length string, say 4
> then in a function at some time, I want to set the string to a
> constant value, say a
> below is my code but it fails
> what is the correct code?
> many thx!
>
>
> char string[4] = {0};
>
> string = 'a '; /* <-- failed */
memcpy("abcd", string, sizeof(string));
- Pete
- Next message: James Connell: "Re: api call from c++"
- Previous message: Ben Measures: "Re: api call from c++"
- In reply to: Alan: "[C] simple string question"
- Next in thread: Alan: "Re: [C] simple string question"
- Reply: Alan: "Re: [C] simple string question"
- Reply: Leor Zolman: "Re: [C] simple string question"
- Reply: E. Robert Tisdale: "Re: [C] simple string question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|