how to write a data 10 in address location 0x2000

Answer Posted / vadivel t

The below line u can use for the question asked, provided
the address is not pointing to any OS memory, system files
or any location on ROM memory.

0x2000 is invalid address(Access voilation)in my system. So
I tried with the valid address 0x12FF70 to get the o/p.

main()
{
*(int *)(0x12FF70)= 20;
printf("%d \n",*(int *)(0x12FF70));
getch();
}

O/p would be 20.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a stream in c programming?

587


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

653


Write a simple code fragment that will check if a number is positive or negative.

702


What is the difference between variable declaration and variable definition in c?

555


Explain what is page thrashing?

603






How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

649


What is page thrashing?

647


What is the benefit of using const for declaring constants?

579


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

1569


What is the maximum no. of arguments that can be given in a command line in C.?

660


What does typeof return in c?

633


Do pointers take up memory?

647


What happens if header file is included twice?

646


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

1592


Tell me what is null pointer in c?

604