int main(int argc, char* argv[])
{
//use for cycle
int i,j;
//define the data
int rows,cols;
int **mydata;
//for open file use
FILE *input;
if(argc <= 1)
/*NOTES FROM MSDN
argc
An integer specifying how many arguments are passed to the program
from the command line. Because the program name is considered an
argument, argc is at least 1.
*/
printf("Hello World!\n");
else
{//Input datas from file
//Try to open the file and check open OK or NOT!
//Input the data from the datafile "datafile.txt"
/*NOTES FORM MSDN
argv
An array of null-terminated strings.
It can be declared as an array of pointers to char (char
*argv[ ] ) or as a pointer to pointers to char (char **argv).
The first string (argv[0]) is the program name,
and each following string is an argument passed to the
program from the command line. The last pointer (argv[argc])
is NULL.
*/
if( (input=fopen(argv[1],"rt")) != NULL )
{
fscanf(input,"%d%d",&rows,&cols);
mydata = (int**)malloc(rows*sizeof(int*));
for(i=0; i<rows; i++) mydata[i] = (int*) malloc(cols*sizeof(int));