CoolInterview.com - World's Largest Collection of Interview Questions
Start Your Own website Now
Sponsored Links

Interview Questions
Our Services

Get 9,000 Interview Questions & Answers in an eBook.


  • 9500+ Pages
  • 9000 Question & Answers
  • All Tech. Categories
  • 14 MB Content

    Get it now !!



    Send your Resume to 6000 Companies


  • INTERVIEW QUESTIONS LANGUAGES DETAILS
    Question :
    Write a c program to find size of structure without using sizeof operator ?



    Category Languages Interview Questions
    Rating (0.3) By 176 users
    Added on 7/22/2011
    Views 332
    Rate it!
    Answers:

    struct ABC{
    int a;
    float b;
    char c;
    };
    void main(){
    struct ABC *ptr=(struct ABC *)0;
    ptr++;
    printf("Size of structure is: %d",*ptr);
    }



    #include<stdio.h>
    int main(){
    int i=5;
    int *ptr=&i;
    *ptr=(int *)20;
    printf("%d",i);
    }



    Posted by: Aditya sahu    

    Contact Aditya sahu Contact Aditya sahu

    If you have the better answer, then send it to us. We will display your answer after the approval.
    Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    What is the meaning of scope of a variable?


    View Answer
    Write a c program to modify the constant variable in c?


    You can modify constant variable with the help of pointers. For example:

    #include<stdio.h>
    int main(){
    int i=10;
    int *ptr=&i;
    *ptr=(int *)20;
    printf("%d",i);
    }
    View Answer
    What is the meaning of prototype of a function ?


    View Answer
    Why we use static variable in c? Tell me all properties of static variables which you know?


    View Answer
    Why we use do-while loop in c?
    View Answer
    What is and why array in c ?


    View Answer
    Do you know memory representation of
    int a = 7; ?




    View Answer
    What are merits and demerits of array in c?



    View Answer
    What is wild pointer in c ?


    View Answer
    What will be output of following c program?

    int *call();
    void main(){
    int *ptr;
    ptr=call();
    clrscr();
    printf("%d",*ptr);

    }
    int * call(){
    int x=25;
    ++x;
    return &x;
    }

    View Answer
    What is dangling pointer in c?
    View Answer
    Swap two variables without using third variable.



    View Answer
    Write a c program without using any semicolon which output will : Hello word.




    View Answer
    What is the purpose of the Literature Review?

    View Answer
    How are pointer variables initialized?
    View Answer
    When should a far pointer be used?
    View Answer
    What is static memory allocation and dynamic memory allocation?
    View Answer
    What is the difference between text and binary modes?
    View Answer
    What is a null pointer?

    View Answer
    When does the compiler not implicitly generate the address of the first element of an array?
    View Answer


    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL Languages Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2014 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions

    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | C Interview Questions & Answers

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes


    Cache = 0 Seconds