[Beowulf] Re: A start in Parallel Programming?
Many of your questions may have already been answered in earlier discussions or in the FAQ. The search results page will indicate current discussions as well as past list serves, articles, and papers.
Peter St. John peter.st.john at gmail.comWed Mar 14 08:43:46 PDT 2007
- Previous message: [Beowulf] Re: A start in Parallel Programming?
- Next message: [Beowulf] Weird problem with mpp-dyna
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Skipped content of type multipart/alternative-------------- next part --------------
#include <stdio.h>
#define NFUNCS 2
int add1(int n);
int add2(int n);
int main(int argc, char **argv)
{
//printf("The entry point of \"printf\" is %0x\n", printf);
char c;
int (*funcTab[NFUNCS])(int);
funcTab[0] = (add1);
funcTab[1] = (add2);
printf("Would you like to add 1 or 2? (1, 2, q, Q): ");
c = getchar();
putchar(getchar());
if(c < '1' || c > '2')
{
printf("Exiting.\n");
return 0;
}
printf("The value of 10 incremented is %d\n", ((funcTab[c-'1'])(10)));
return 0;
}
int add1(int n)
{
return n+1;
}
int add2(int n)
{
return n+2;
}
- Previous message: [Beowulf] Re: A start in Parallel Programming?
- Next message: [Beowulf] Weird problem with mpp-dyna
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Beowulf mailing list
