No, in your getAlpha() you are trying to de-reference a pointer but you did not decalre alpha as a pointer.
A simple example may help -
Code:
#include <stdio.h>
/* declare your function*/
void getAlpha(int &alpha){
printf("Alpha's value = %d \n",alpha);
}
int main(int argc, char* argv[])
{
/* decalre and initialise a normal int var.*/
int alphavalue = 6;
/* declare a pointer that points to an int (holds its address)
but currently holds nothing and will crash your app if you don't
point it to something before using it!*/
int * alpha = NULL;
/*pass the address of the normal int, now the pointer
actually points to something, very important!*/
alpha = &alphavalue;
/* use your function, now you can dreference your pointer */
getAlpha(*alpha);
return 0;
}
<edit> wow, you guys are fast, nearly half a dozen posts while I was writing mine!