[C] simple string question
From: Alan (alanchoiyimlung_at_sinatown.com)
Date: 02/05/04
- Next message: Jerry Coffin: "Re: [C, C++] "(a=b) = c;" Illegal or Undefined?"
- Previous message: Russell Hanneken: "Re: basic question on C++"
- Next in thread: AirPete: "Re: [C] simple string question"
- Reply: AirPete: "Re: [C] simple string question"
- Reply: Josh Sebastian: "Re: [C] simple string question"
- Reply: E. Robert Tisdale: "Re: [C] simple string question"
- Reply: Christopher Benson-Manica: "Re: [C] simple string question"
- Reply: ChrisJForeman: "Re: [C] simple string question"
- Reply: Alan: "Re: [C] simple string question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 5 Feb 2004 10:44:58 +0800
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 */
- Next message: Jerry Coffin: "Re: [C, C++] "(a=b) = c;" Illegal or Undefined?"
- Previous message: Russell Hanneken: "Re: basic question on C++"
- Next in thread: AirPete: "Re: [C] simple string question"
- Reply: AirPete: "Re: [C] simple string question"
- Reply: Josh Sebastian: "Re: [C] simple string question"
- Reply: E. Robert Tisdale: "Re: [C] simple string question"
- Reply: Christopher Benson-Manica: "Re: [C] simple string question"
- Reply: ChrisJForeman: "Re: [C] simple string question"
- Reply: Alan: "Re: [C] simple string question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|