Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

diiferent between * and & in c

void funct(int a) // A declaration of a function, a is declared
void funct(int *a) // a is declared as a pointer
void funct(int &a) // a now receives only pointers (address)

funct(a) // Creates a copy of a
funct(*a) // Uses a pointer, can create a pointer of a pointer in some cases
funct(&a) // Sends an address of a pointer
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #diiferent
ADD COMMENT
Topic
Name
2+1 =