[C] simple string question

From: Alan (alanchoiyimlung_at_sinatown.com)
Date: 02/05/04


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 */



Relevant Pages

  • Re: Can I call Obj-C from a C++ source?
    ... The correct code is: ... If the string being substituted in was user input, ... vulnerable to a format string attack. ... That said, if you want to use NSLog from C or C++ code, and have a real reason ...
    (comp.sys.mac.programmer.help)
  • Re: Java program is not evaluating String value correctly...
    ... >:State Abbreviation and compare it for state specific programming. ... >:When it wasn't falling through the correct code, ... The way I'm filling the state abbreviation string ...
    (comp.lang.java.programmer)
  • Re: Field form
    ... >I would like to know how is the correct code that use inside the filed ... Function Combined(Invinitiv As String, Im1 As String) As String ... Dim MyArray() ...
    (microsoft.public.access.forms)
  • [C] simple string question
    ... I want to define a constant length string, ... below is my code but it fails ... what is the correct code? ... many thx! ...
    (comp.lang.c)
  • Re: [C] simple string question
    ... > Alan wrote: ... >> then in a function at some time, I want to set the string to a ... >> what is the correct code? ... the program crashes ...
    (comp.lang.c)