Today's class seemed a little confusing to some.
Basically what he was saying is when your casting just take the type and put that in front of the pointer. Here's a simple example...
double example1(int, int, double);
/* Create pointer to a void type */
double holder = 0;
/*Cast pointer of void type to function type wanted */
p = (*(double (*)(int, int, double))p);
/*Let pointer be pointed to function start */
p = example1;
/*Run pointer and hold returned value */
holder = *p(2, 4, 5);
Thursday, June 3, 2010
Todays class was interesting to say the least for the tangent Fardad went off on strings.
char hello = "hello everyones, how's it going"
where, the variable hello is compatible to the string "hello everyones, how's it going"
so that you can actually do the following:
printf("%c", "hello everyones, how's it going");
which is the same as,
The string you put the variable equal are identical to each other in the usage aspect.