void main()
{
int *i = 0x400; // i points to the address 400
*i = 0; // set the value of memory location pointed by i;
}
Answers were Sorted based on User's Feedback
Answer / amit kumar kunwar
as i is pointing to the address 400 and getting assigned a value of 0. this code is working perfectly. hence the Output is 0 for this code.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / susie
Answer :
Undefined behavior
Explanation:
The second statement results in undefined behavior because
it points to some location whose value may not be available
for modification. This type of pointer in which the
non-availability of the implementation of the referenced
location is known as 'incomplete type'.
Is This Answer Correct ? | 0 Yes | 1 No |
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }
Write a program to receive an integer and find its octal equivalent?
How to return multiple values from a function?
typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }
main() { char a[4]="HELLO"; printf("%s",a); }
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above
Sir... please give some important coding questions asked by product companies..
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
Under linux environment can u please provide a c code for computing sum of series 1-2+3-4+5......n terms and -1+2-3+4-5...n terms..
I need your help, i need a Turbo C code for this problem.. hope u'll help me guys.? Your program will have a 3x3 array. The user will input the sum of each row and each column. Then the user will input 3 values and store them anywhere, or any location or index, temporarily in the array. Your program will supply the remaining six (6) values and determine the exact location of each value in the array. Example: Input: Sum of row 1: 6 Sum of row 2: 15 Sum of row 3: 24 Sum of column 1: 12 Sum of column 2: 15 Sum of column 3: 18 Value 1: 3 Value 2: 5 Value 3: 6 Output: Sum of Row 1 2 3 6 4 5 6 15 7 8 9 24 Sum of Column 12 15 18 Note: Your program will not necessary sort the walues in the array Thanks..