C
code break
Can Any one tell me why this program is crashing .
testFunc()
{
int a1[10], *ptr ;
f=&a1[0];
f=f+1;
return 0;
}
testFunc()
{
int a1[10], *ptr ;
f=&a1[0];
f=f+1;
return 0;
}
code said:Can Any one tell me why this program is crashing .
testFunc()
{
int a1[10], *ptr ;
f=&a1[0];
f=f+1;
return 0;
}
code said:Can Any one tell me why this program is crashing .
testFunc()
{
int a1[10], *ptr ;
f=&a1[0];
f=f+1;
return 0;
}
code said:Can Any one tell me why this program is crashing .
NO. For why, see below.
testFunc()
int testFunc(void) /* much better style */
{
int a1[10], *ptr ;
f=&a1[0];
f=f+1;
return 0;
}
Because it's not a program? Show as a compilable minimum C program that
exhibits whatever problem you have. What you posted does not even
compile as a separate compilation unit to be later linked into a proper
program (e.g. you never define `f`).
code said:Can Any one tell me why this program is crashing .
NO. For why, see below.
testFunc()
int testFunc(void) /* much better style */
{
int a1[10], *ptr ;
f=&a1[0];
f=f+1;
return 0;
}
Because it's not a program? Show as a compilable minimum C program that
exhibits whatever problem you have. What you posted does not even
compile as a separate compilation unit to be later linked into a proper
program (e.g. you never define `f`).
Nikunj said:This is not crashing its working absolutely fine.
Vladimir said:code said:Can Any one tell me why this program is crashing .
NO. For why, see below.
testFunc()
int testFunc(void) /* much better style */
{
int a1[10], *ptr ;
f=&a1[0];
f=f+1;
return 0;
}
Because it's not a program? Show as a compilable minimum C program that
exhibits whatever problem you have. What you posted does not even
compile as a separate compilation unit to be later linked into a proper
program (e.g. you never define `f`).
code said:Can Any one tell me why this program is crashing .
testFunc()
{
int a1[10], *ptr ;
f=&a1[0];
f=f+1;
return 0;
code said:Can Any one tell me why this program is crashing .
testFunc()
{
int a1[10], *ptr ;
f=&a1[0];
f=f+1;
return 0;
}
Pedro Graca said:code break wrote: [...]testFunc()
int testFunc(void)
or
int testFunc(...) /* this looks strange. I have to review variable
argument list material */
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.