×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    35

    enum is behaving in a different way

    I defined enumeration with name hs_enum_test in a header file.As follows

    typedef enum hs_enum_test
    {
    HS_ONE ,
    HS_TWO
    }hs_enum_test_t;

    After that i included that header file in a CPP file.I called a function like hs_enum_test(TRUE),but carbide.c++ is not giving any error , instead it is giving "statement has no effect".Why is it not giving any compile error?.And what is effect of it in code.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: enum is behaving in a different way

    You have not called a function, but casted "TRUE" to hs_enum_test, then forgot the result.
    When you do not want to make anything, you can also write
    Code:
    1;
    and the compiler will be happily do not anything with that.

    Quote Originally Posted by sivareddy_jntu View Post
    instead it is giving "statement has no effect".

    what is effect of it in code.
    Remember: the compiler is usually right ...

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    35

    Re: enum is behaving in a different way

    Thank you for quick replay.Now i got the concept .

Similar Threads

  1. enum keyword?
    By mika19 in forum Mobile Java General
    Replies: 9
    Last Post: 2010-01-20, 16:51
  2. Nameless enum definition
    By leejx in forum Symbian
    Replies: 4
    Last Post: 2008-12-19, 03:02
  3. Replies: 19
    Last Post: 2008-08-02, 02:53
  4. Converting C++ Enum to Javascript Var
    By danimov in forum Symbian
    Replies: 3
    Last Post: 2008-07-24, 02:05
  5. Battery status using js file (C++ enum to javascript var?)
    By danimov in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2008-07-23, 20:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •