how to write a data 10 in address location 0x2000

Answers were Sorted based on User's Feedback



how to write a data 10 in address location 0x2000..

Answer / vishnu

int main()
{
int *ptr;
ptr = (int *)0x2000;
*ptr = 10;
printf("%d", *ptr);
}

Is This Answer Correct ?    5 Yes 1 No

how to write a data 10 in address location 0x2000..

Answer / vatsava

int main()
{
int *ptr;
ptr = (int *)2000;
*ptr = 10;
printf("%d", *ptr);
}

Is This Answer Correct ?    1 Yes 0 No

how to write a data 10 in address location 0x2000..

Answer / 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

More C Interview Questions

How do I create a directory? How do I remove a directory (and its contents)?

0 Answers  


How Many Header Files in c?

2 Answers   TCS,


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

0 Answers  


write a program to find a given no. is divisible by 3 or not without using any arthimetic operators?

3 Answers   Broadcom, TCS,


What do you mean by a sequential access file?

0 Answers  


What is array of structure in c?

0 Answers  


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

0 Answers  


What is the difference between the = symbol and == symbol?

0 Answers  


Symmetric technologies interview questions. For Computer science candidates the first round is a objective type written test consisting of 16 questions.It is very easy ,any police man can solve this. And next round is a written test consists of both objective and subjective .Total 40 question related to c,c++ and operating system related questions. And then a technical interview and give some program to solve with computer.The md is adamant person, whatever he says we have to accept that is the condition. And one more thing ,,,these interview is just for a formality..the company will select only innocent guys.. the person's without a backbone only they require.. And u have to submit the certificates this is the most important problem...So if you are not getting any other jobs..then only join with this... It is better to try for other company...And apart from that symmetric do a lot of projects..If a candidate can manage everything u can join and make good career with this company... The Md will normally speak rudely..but he is good person and he will give you a lot of very good chances to improve your career....but with cheap salary....

0 Answers   Symmetric Technologies,


What is #include stdio h and #include conio h?

0 Answers  


Create a simple code fragment that will swap the values of two variables num1 and num2.

0 Answers  


How many bytes are occupied by near, far and huge pointers (dos)?

0 Answers  


Categories