Thread: really uwuick varible question

  1. #1
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608

    really uwuick varible question

    can varibles be two words? e.i.
    char two words[] = "2 words";
    Email: [email protected] || AIM: MisterSako || MSN: [email protected]

    -the shroom has spoken

  2. #2
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    yup. but not like that...

    use strings...

    first include a string header string.h or cstring.h

    Code:
    string 2_words;
    
    .
    .
    .
    
    2_words = " Look im a variable that holds crap! ";


    an array like your example can only hold one thing at a time...
    like

    Code:
    char 2words[] = { '2', ' ', 'w', 'o', 'r', 'd', 's' }
    Last edited by Vicious; 06-15-2002 at 12:23 PM.
    What is C++?

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >but not like that...
    Nor like your example. Identifiers cannot start with a number.
    The closest you can get to the original question is:

    char two_words[] = "2 words";

    -Prelude
    My best code is written with the delete key.

  4. #4
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    [edit]
    omg, im sooo sorry... i just now understood the question.

    you meant can the actual variable have 2 words like

    int two words... heh sorry.
    [/edit]
    Last edited by Vicious; 06-15-2002 at 12:39 PM.
    What is C++?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  2. accessing varible in a c++ class
    By jccharl in forum C++ Programming
    Replies: 1
    Last Post: 03-10-2004, 03:01 PM
  3. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  4. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM