All 1 entries tagged Computer
View all 31 entries tagged Computer on Warwick Blogs | View entries tagged Computer at Technorati | There are no images tagged Computer on this blog
October 16, 2007
passing variables to subroutines in C
I always forget how to do it!
//declare variable globally
int TINF;
//in the subroutine use a * for a pointer, and then continue throughout
void epi_stats(int *TINF) {
*TINF = something;
}
//in the main program call the subroutine and assign the value using &
int main(int argc, char** argv) {
epi_stats(&TINF);
}