What's the difference?

This is a discussion on What's the difference? within the C Programming forums, part of the General Programming Boards category; int a[10];what's the difference between a and &a?int apricot[2][3][5];int *t=apricot [0][1];So t is a pointer to array or a pointer ...

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    1

    What's the difference?

    int a[10];what's the difference between a and &a?int apricot[2][3][5];int *t=apricot [0][1];So t is a pointer to array or a pointer to integer?apricot[0][1] means &apricot[0][1] or &apricot[0][1][0]?
    Last edited by cuicle; 09-30-2011 at 02:32 PM.

  2. #2
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    '&' in the context that you are using gived the address of, vice the value of the variable. Take a look at: Lesson 6:Pointers and Prelude's Pointer Tutorial.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    1,485
    Quote Originally Posted by cuicle View Post
    int a[10];what's the difference between a and &a?int apricot[2][3][5];int *t=apricot [0][1];So t is a pointer to array or a pointer to integer?apricot[0][1] means &apricot[0][1] or &apricot[0][1][0]?
    In your first example there is no difference. But your question is barely comprehensible IMO.

    I recommend that you print the variables yourself and investigate what the difference is.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Difference between ROM and RAM..
    By shwetha_siddu in forum C Programming
    Replies: 18
    Last Post: 06-23-2008, 04:23 AM
  2. Difference of RAM
    By windoze victim in forum Tech Board
    Replies: 25
    Last Post: 01-30-2003, 05:33 PM
  3. Difference b/w B.Sc. AND B.E.
    By Zeeshan in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 08-04-2002, 01:19 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21