char variable C

Discussion in 'Computer Programming, Emulation, and Game Modding' started by sightlight, May 19, 2015.

  1. sightlight
    OP

    sightlight GBAtemp Fan

    Member
    423
    43
    Aug 5, 2009
    United States
    Dear friends,

    Do you guys know how to declare a char variable longer than 1 character.

    I have tried but no wanted result.

    char greeting = 'Hello World';

    printf("%s", greeting);
     
  2. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    12,330
    5,342
    Mar 17, 2010
    Norway
    Alola
    char* greeting = "Hello World";
    Which is effectively just a pointer to an array of char that's handled semi-intelligently by code/the compiler.
     
  3. sightlight
    OP

    sightlight GBAtemp Fan

    Member
    423
    43
    Aug 5, 2009
    United States
    Thank you, completely solved the problem.