Thread: int s: 3 ; declaration in structure is possible

  1. #1
    kotin
    Join Date
    Oct 2009
    Posts
    132

    int s: 3 ; declaration in structure is possible

    Code:
    #include<stdio.h>
    struct a
    {
    int s: 3;
    };
    
    int main()
    {
    struct a a1; 
    printf("%d \n",a1.s);
    return 0;
    }

    is there any use by defining int s: 3; with this systax program is compiling and linking.

    wts the inner secret of this systx int s:3

    i can apreciate any replys

  2. #2
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804
    Google bit fields for that.
    HOPE YOU UNDERSTAND.......

    By associating with wise people you will become wise yourself
    It's fine to celebrate success but it is more important to heed the lessons of failure
    We've got to put a lot of money into changing behavior


    PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
    IDE- Microsoft Visual Studio 2008 Express Edition

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    399
    It's a bit field: C Bit Fields (C)

  4. #4
    kotin
    Join Date
    Oct 2009
    Posts
    132
    Thanks for your replys

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. NEED HELP READING FILE and PRINTING
    By geoffr0 in forum C Programming
    Replies: 4
    Last Post: 04-16-2009, 05:26 PM
  2. Game Won't Compile
    By jothesmo in forum C++ Programming
    Replies: 2
    Last Post: 04-01-2006, 04:24 PM
  3. Replies: 2
    Last Post: 03-24-2006, 08:36 PM
  4. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM
  5. A Simple (?) Problem
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 10-12-2001, 04:28 AM