Search:

Type: Posts; User: skyr6546

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    134

    struct Node * Add_Node( int data, struct Node *p...

    struct Node * Add_Node( int data, struct Node *p ){

    struct Node *new = malloc(sizeof(*new));
    new-> value = data;
    new->next = p;
    printf("new : %p \n", new);
    return new;
    }
    ...
  2. Replies
    4
    Views
    134

    Printing address of structure pointer

    I have compiled my code codes but I do not understand what is happening from the output of the code



    #include<stdio.h>

    #include<stdlib.h>

    struct Node{
    int value;
  3. Am I right about dynamic memory allocation

    Dynamic memory allocation means that memory can be allocated at run time.


    #include<stdio.h>

    struct product {
    int id; /* Part number */
    char * name; /* Part name ...
  4. it say dot will use to access structure member...

    it say dot will use to access structure member but there is no information why the dot will only use.

    Does structure variable point structure member to assign value ?
  5. Why need a dot between structure variable and structure member ?

    Why need a dot between structure variable and structure member ?


    #include<stdio.h>

    struct Point {
    int x, y;
    };

    int main() {
  6. Replies
    7
    Views
    245

    Output of program address of p : 00000000...

    Output of program

    address of p : 00000000
    address of p : 007113A8
    address of p->x : 007113A8
    value of p->x : A
    value of p->x : B
    address of p : 007113A8
    address of p->x : 007113A8
    address...
  7. Replies
    7
    Views
    245

    I didn't understand p->x = 8; I understand...

    I didn't understand

    p->x = 8;

    I understand p is pointer and it pointing to the object x of structure. p hold the memory location of x and value stored in x is 8
  8. Replies
    7
    Views
    245

    my another doubts p->x is initialized to 8...

    my another doubts

    p->x is initialized to 8 or only x is initialized to 8



    p->x ; // p is a pointer to an object of struct point. it point to the object of structure x but p->x is...
  9. Replies
    7
    Views
    245

    pointer to structure in c

    I have written code to understand pointer to structure


    #include<stdio.h>
    #include<stdlib.h>


    struct point //define structure
    {
    int x; //structure member type integer
  10. Replies
    3
    Views
    237

    I was just trying to acess the array (structure...

    I was just trying to acess the array (structure member)

    Am I really following good example ?


    #include<stdio.h>
    struct s
    {
    int A[10]; //structure member
    }v;
  11. Replies
    3
    Views
    237

    How to access a array in a struct?

    I have written code to access array element in structure

    #include<stdio.h>

    struct s
    {
    int A[10]; //structure member
    }v;
  12. Replies
    5
    Views
    205

    Structure size = (H->n) + (H->m) + (H->N) ...

    Structure size = (H->n) + (H->m) + (H->N)
    = 1 + 1 + 4
    = 6

    But compiler showing size is 8 bytes

    Am I wrong in my calculation? I do not understand why it show two extra...
  13. Replies
    5
    Views
    205

    Size of structure

    I wrote code like this

    #include<stdio.h>#include<stdlib.h>
    struct Name{
    char n;
    char m;
    struct Name *N;
    };
    void main (){
    struct Name *H = (struct Name*)malloc(sizeof (struct Name));
  14. I did not understand your answer It would be even...

    I did not understand your answer It would be even better if you gave an example as I gave
  15. difference between declaration and definition of a variable?

    Hi everybody

    I am declaring and initializing variable n in my code. I do not understand what meaning of define the variable in c


    #include<stdio.h>void main()
    {
    int n //declar...
  16. Replies
    4
    Views
    238

    My question is for C language only ?

    My question is for C language only ?
  17. Replies
    4
    Views
    238

    What is qualifier in c

    this is not assignment and homework question

    My question is what do you understand term 'qualifier" in c language

    I am neither asking about const nor asking about volatile. I know both are...
  18. My mistake #include int...

    My mistake


    #include <stdio.h>
    int main(void)
    {
    const int x = 20;

    printf("x = %d \n", x);
  19. When we should really use constant and define

    code with define keyword

    #include <stdio.h>

    #define x 20


    int main(void)
    {
    printf("x = %d \n", x);
  20. Replies
    4
    Views
    240

    Hi Hodor I am still confuse. look at following...

    Hi Hodor

    I am still confuse. look at following code it will not compile it's just example of timer interrupt. assume interrupt generate at every 1 second


    #include<microcontroller.h>
    ...
  21. Replies
    4
    Views
    240

    volatile variable c program

    I have been spent so much time on google to find complete code for volatile variable in c language. I am so confused by reading a lot of theoretical answer

    Definition : "The volatile keyword tells...
  22. Replies
    1
    Views
    141

    External variable in c language

    Extern keyword tell to compiler that this variable is declared in another C file but we can use it in current file

    Lets say we have two files
    File1.c
    File2.c

    First method
    I have...
  23. Replies
    1
    Views
    179

    what is use of volatile keyword in c

    I have been spent so much time to understand volatile keywor I am so confused by reading a lot of theoretical answer

    Definition : "The volatile keyword tells the compiler that the value of the...
  24. Replies
    5
    Views
    382

    Does it make any sense ? function pass integer...

    Does it make any sense ?

    function pass integer pointer and return integer pointer


    #include <stdio.h>
    int* fp(int *value);

    int main(void) // The function main() returns an int, not...
  25. Replies
    5
    Views
    382

    return pointer from function

    I have read a lot of information online but still can't figure out how to return pointer pointer from function

    I made small example


    #include <stdio.h>

    int* fp(void);
Results 1 to 25 of 27
Page 1 of 2 1 2