Thread: deep confuse with pointer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2020
    Posts
    23

    deep confuse with pointer

    Hi,

    I am deeply confuse with pointer after so many reading

    Pointer is variable that hold memory location of variable. variable may be a different type like int, char, float..

    I am confused with pointer to structure.

    Code:
    #include<stdio.h>
    
    struct structure_name
    {
        int i;
        char c;
        float f;
        struct structure_name * n;
    }
    
    
    int main ()
    {
        struct structure_name * structure_variable = NULL;
        
         structure_variable = malloc (sizeof(structure_variable));
    
         structure_variable->i;
         structure_variable->c;
         structure_variable->f;
    
    
        return 0;    
    }

    Does pointer store the memory location of structure or location of structure member?

    structure_variable->i; Pointer hold the memory location of structure member i variable i is integer variable
    Last edited by Parth12; 02-18-2020 at 11:43 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Functions confuse me so, what am i doing wrong?
    By Ctylersills in forum C Programming
    Replies: 11
    Last Post: 04-20-2019, 04:22 AM
  2. I'm new to C, confuse with something..
    By Milo Juak MuTou in forum C Programming
    Replies: 5
    Last Post: 05-14-2012, 09:38 AM
  3. PayPal confuse me
    By Akkernight in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 04-20-2009, 11:56 AM
  4. a little confuse o_0???
    By omarbags in forum C++ Programming
    Replies: 15
    Last Post: 01-24-2008, 01:03 AM
  5. Too confuse
    By dv007 in forum C++ Programming
    Replies: 6
    Last Post: 07-25-2002, 05:33 PM

Tags for this Thread