D
Dawn Minnis
Hi
When I compile my files I get the following:
driver.c: In function `main':
driver.c:49: warning: assignment makes integer from pointer without a
cast
driver.c:50: warning: assignment makes integer from pointer without a
cast
driver.c:51: warning: assignment makes integer from pointer without a
cast
getparams.c: In function `getparams':
getparams.c:8: warning: assignment makes pointer from integer without
a cast
lines 49, 50 and 51 in driver refer to the lines
m = params[0];
n = params[1];
k = params[2];
and line 8 in getparams refers to the line
params[x] = atoi(argv[val]);
Can someone tell me why I'm getting this error message and how to fix
it. Needless to say, the program when ran from command prompt as for
example:
./test.o n y 4 5 6
does produce the desired output.
Please help find the problem thats causing the error.
Kind regards
Dawn
A cut down version of my main driver.c file looks like this:
#include <stdio.h>
#include <stdlib.h>
extern void getparams(int argc, char *argv[], int *params[]);
int main(int argc, char *argv[])
{
int c, m, n, k, lda, ldb, ldc;
int *params[10];
if(argc > 1)
{
/*Run getparams*/
getparams(argc, argv, params);
m = params[0];
n = params[1];
k = params[2];
printf("m= %i", m);
printf("n= %i", n);
printf("k= %i", k);
}
return 0;
}
My getparams.c file looks like this:
void getparams(int argc, char *argv[], int *params[])
{
int val=2, x=0;
for(val=2; val<argc; val++)
{
params[x] = atoi(argv[val]);
x++;
}
}
When I compile my files I get the following:
driver.c: In function `main':
driver.c:49: warning: assignment makes integer from pointer without a
cast
driver.c:50: warning: assignment makes integer from pointer without a
cast
driver.c:51: warning: assignment makes integer from pointer without a
cast
getparams.c: In function `getparams':
getparams.c:8: warning: assignment makes pointer from integer without
a cast
lines 49, 50 and 51 in driver refer to the lines
m = params[0];
n = params[1];
k = params[2];
and line 8 in getparams refers to the line
params[x] = atoi(argv[val]);
Can someone tell me why I'm getting this error message and how to fix
it. Needless to say, the program when ran from command prompt as for
example:
./test.o n y 4 5 6
does produce the desired output.
Please help find the problem thats causing the error.
Kind regards
Dawn
A cut down version of my main driver.c file looks like this:
#include <stdio.h>
#include <stdlib.h>
extern void getparams(int argc, char *argv[], int *params[]);
int main(int argc, char *argv[])
{
int c, m, n, k, lda, ldb, ldc;
int *params[10];
if(argc > 1)
{
/*Run getparams*/
getparams(argc, argv, params);
m = params[0];
n = params[1];
k = params[2];
printf("m= %i", m);
printf("n= %i", n);
printf("k= %i", k);
}
return 0;
}
My getparams.c file looks like this:
void getparams(int argc, char *argv[], int *params[])
{
int val=2, x=0;
for(val=2; val<argc; val++)
{
params[x] = atoi(argv[val]);
x++;
}
}