• 2
    0
    Pointer concept challnege eevryone trying to learn C programming language. conecpt is easy every location in the memory has address. variable occupy a memory location, which has address of course. pointer is just kind of variable which holds that address. you use '&' sign to access a variable address, and use '*' sign to access the content of that address.e.g int *pointer= &counter means, get the address of 'counter' variable and store it in 'pointer' variable. now if you want to print the address you write 'pointer' which prints out the address of the 'counter variable. you could also use '&counter'. on the other hand if you want to print out the contetnt of that memory location you write '*pointer'. Now, back to the first question. the difference depends on the variable name come after thetype name. if you define like 'int* pointer1, pointer2;' , it means you define a integer pointer and a normal integer variables. if you define like 'int *pointer1, *pointer2' it simply means you define 2 integer pointers. hope this clarify things a bit. adios
    Refrence : 1 item Show Refrence
    • 2013-04-05 09:10:10Z
    • Root Comment : 0 Sub Comment : 0
    • Visited : 2
    • Send Comment