Ashokkumar01cbe
Broken In
#include <stdio.h>
#include <math.h>
main()
{
float x,y;
long int i, j, m[6], *k[5] ;
char *letter, *course[3], name [ ] = "I I T Madras";
course[0]="Numerical Methods";
course[1]=" and Programming";
printf ("\n%s %s\n ", course[0], course[1]) ;
for(i=0;i<=5;i++)
m=3*i;
k[0]=&m[1];
k[3]=&m[3];
j=k[3] - k[0];
printf ("\n%d %d %d %d\n ", j, *k, *(k[0]+1), *k[3]) ;
}
i compile this program in a gcc compiler,in this program i struck at the last line that on printing *k as %d it needs to print the first element of the array (ie.. 0) instead it is displaying an address..please help me to solve this .....
#include <math.h>
main()
{
float x,y;
long int i, j, m[6], *k[5] ;
char *letter, *course[3], name [ ] = "I I T Madras";
course[0]="Numerical Methods";
course[1]=" and Programming";
printf ("\n%s %s\n ", course[0], course[1]) ;
for(i=0;i<=5;i++)
m=3*i;
k[0]=&m[1];
k[3]=&m[3];
j=k[3] - k[0];
printf ("\n%d %d %d %d\n ", j, *k, *(k[0]+1), *k[3]) ;
}
i compile this program in a gcc compiler,in this program i struck at the last line that on printing *k as %d it needs to print the first element of the array (ie.. 0) instead it is displaying an address..please help me to solve this .....