enumeration with switch case?

This is a discussion on enumeration with switch case? within the C++ Programming forums, part of the General Programming Boards category; Use strlen, the sizeof operator returns 4 (it's a pointer)....

  1. #16
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680
    Use strlen, the sizeof operator returns 4 (it's a pointer).

  2. #17
    Shadow12345
    Guest
    it says to use sizeof() in the opengl game programming book, but I'll try strlen

  3. #18
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    sizeof only works if it's a char[], not with a char*
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How can I make this code more elegant?
    By ejohns85 in forum C++ Programming
    Replies: 3
    Last Post: 04-02-2009, 08:55 AM
  2. A Full Program to analyze.
    By sergioms in forum C Programming
    Replies: 2
    Last Post: 12-30-2008, 08:42 AM
  3. Replies: 27
    Last Post: 10-11-2006, 04:27 AM
  4. Problems with switch()
    By duvernais28 in forum C Programming
    Replies: 13
    Last Post: 01-28-2005, 09:42 AM
  5. rand()
    By serious in forum C Programming
    Replies: 8
    Last Post: 02-15-2002, 01:07 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21