to write a program to search a character in a string and to
print till the character in the string using pointers in c
program

Answer Posted / guest

char str[20]="some string";
char *ptr=str;
char search_char=e;
for(int t=0;i<strlen(str);i++)
{
if((*ptr)==e) (*ptr)=\0' //null charachter
}
printf("%s",str);

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

WHAT IS THE PROPER LOCATION OF SAMPLE POINT OF LPG SPHERE TANK?

1945


hi... i just want to know that how could join the AAI with an B.E back ground??? please help me out.

1567


Based on the Job Description above, please indicate in details why you are a good match for this position?

1494


plz send me interview questions & answers of Data Structure

1600


How do aeroplanes fly? Why can some fly up-side down?

594






I am refused L1-B visa filed by my employer on May 09 by US consulate Chennai. When i am eligible to apply L1-B visa again through my employer?

1811


How To Servers For Malitnationl Bank?

1410


Tell me about a time when you had too many things to do and you were required to prioritize your tasks

1412


What is the difference between tcp/ip protocol and IP protocol?

1788


What is the actual procedure of charging synthetic oil if the machine is under positive refrigerant pressure.

1265


A code which had some declarations of some data items. There were a couple of normal data items(char,int..) and some pointers as well and a malloc call. You have to find the total memory taken up in the stack(Hint:Pointers and all are allocated in heap, not in stack, so dont count them).Also in most of these questions, they were specifying that the OS was 32 bit

1828


Why is it that a single, all – encompassing metric cannot be developed for programme complexity or programme quality?

1511


how to count number of 3's in 100

1731


Which one is more efficient in terms of required memory space call-by-value or call-by-referance?

1390


i have applied for junior engg. signal II please send me questions papers for it

1472