main()

{

char *p = "hello world";

p[0] = 'H';

printf("%s", p);

}

a. Runtime error.

b. “Hello world”

c. Compile error

d. “hello world”

Answer Posted / deepesh sharma

The Answer is
a) Runtime Error.

Details: hello world is a constant string and the address of
the memory location where this string is stored is assigned
to p. In second line you are changing the value at that
address which is constant string hence changing a constant
is runtime error.

Is This Answer Correct ?    18 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is full form of PEPSI

1857


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2399


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2014


Sir... please give some important coding questions asked by product companies..

1793


Design an implement of the inputs functions for event mode

2955






how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3117


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

1768


could you please send the program code for multiplying sparse matrix in c????

3064


how to test pierrot divisor

2252


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

3704


Write a routine to implement the polymarker function

4373


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2253


write a simple calculator c program to perform addition, subtraction, mul and div.

3137


why nlogn is the lower limit of any sort algorithm?

2369


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

6304