Search results

  1. A

    structure and function to pass the parameter

    I wrote code to store the Id and price of one product. #include <stdio.h> struct Product{ int id; int price; }product1; int main() { /*Assigning id and pric of each product here*/ product1.id = 1; product1.price = 30; /* Displaying product details*/ printf("\n...
  2. A

    Difference between union and structure

    I didn't mean that, int integer = 0; char character = 'A' character variable take 1 byte to store 'A' in memory integer take 4 byte to store integer value 0 in memory Each has different size to store their value They will occupy the same memory location ?
  3. A

    Difference between union and structure

    I am more confused by you're answer
  4. A

    Difference between union and structure

    look post 7, didn't I try to do that ? sizeof gives the size of a variable #include<stdio.h> int main() { printf("%d\n",sizeof(char)); printf("%d\n",sizeof(int)); printf("%d\n",sizeof(float)); printf("%d", sizeof(double)); return 0; } output 1 4 4 and 8 Machine take 1...
  5. A

    Difference between union and structure

    I had asked you before, I thought you would explain by giving examples. I still do not understand, can you explain by giving examples,
  6. A

    Difference between union and structure

    I didn't understand consider example union student{ int roll_number; float mark ; }record; memory space 0001 0002 0003 0004 ....... 0010 how the union will allocate memory space ?
  7. A

    Difference between union and structure

    Example for structure struct student{ int roll_number; float mark ; }record; A struct will allocate space in memory for each of it's members at same time 0001 for int 0002 for float Example for union union student{ int roll_number; float mark ; }record; A union will use...
  8. A

    Difference between union and structure

    can you explain little bit how they will overlap ?
  9. A

    Difference between union and structure

    I've been searching on internet and trying to understand how union is different then structure in c language structure is use to hold different type of data type #include <stdio.h> struct student{ char *name; int age; }record; int main() { record.name = "Ceena"...
  10. A

    i++ and ++i operator

    This gives int main(void) { int a = 0; int b = a++; printf("Value of b is %d \n", b); printf("Value of a is %d \n",a); return 0; } Value of b is 0 Value of a is 1 and int main(void) { int a = 0; int b = ++a; printf("Value of b is %d \n", b); printf("Value...
  11. A

    i++ and ++i operator

    I don't think Its same thing Can you explain How its different ?
  12. A

    i++ and ++i operator

    What is the difference between ++i and ++i, both are increment, but i am confused with their operations. any one kindly make me understand how they both works and what is the output, the output is same i have tried. int main() { int x = 10; x++; printf("x is %d", x); return 0...
  13. A

    How to learn pointer in easy steps

    Consider Program to store five integer value Value : 1 2 3 4 5 program to store five integer using array #include <stdio.h> int main() { int i; int a[5] = {1, 2, 3, 4, 5}; for (i = 0; i < 5; i++) { printf(" Value : %d ", a[i] ); } return 0; }...
  14. A

    How to learn pointer in easy steps

    Harald Kapp, thanks for the response! I have been gone through this website before posting question I understand how to declare and initialize pointer in c language.I have mentioned my understanding in my post. but I feel I don't understand proper concept behind the use of pointer. When you...
  15. A

    How to learn pointer in easy steps

    I’m fairly new here so I'm sorry if this question is not suitable on this forum. I found pointer a little difficult to understand in . Pointer in C language is a variable that store the address of another variable. Let’s start with a simple program to define a integer type variable and a...
Top