P
Pallav singh
Hi ,
is this code legal w.r.t. C standard ?
Kindly also consider C99 and C0x standard also
func( )
{
/* certain statements - A*/
if ( condition - 1) {
/* certain statements - B */
} else if ( condition - 2) {
if ( condition ) {
/* certain statements - C*/
}
int * ptr = malloc( 4 );
// Can we delarecalre variable here
*ptr = 10;
printf( " value at *ptr = %d \n",*ptr);
} else {
/* certain statements - D */
}
return ;
}
}
is this code legal w.r.t. C standard ?
Kindly also consider C99 and C0x standard also
func( )
{
/* certain statements - A*/
if ( condition - 1) {
/* certain statements - B */
} else if ( condition - 2) {
if ( condition ) {
/* certain statements - C*/
}
int * ptr = malloc( 4 );
// Can we delarecalre variable here
*ptr = 10;
printf( " value at *ptr = %d \n",*ptr);
} else {
/* certain statements - D */
}
return ;
}
}