Finding first/last occurrence of a character in a string
without using strchr( ) /strrchr( ) function.
Answer Posted / sepideh
#include<iostream>
#include<conio.h>
using namespace std;
int main(){
char m[20];
char x;
gets(m);
x=getch();
for(int i=0;i!=null;i++)
if(m[i]==x){
cout<<i;}
getch();}
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
What is masking?
What is the -> in c?
Explain how to reverse singly link list.
What is 'bus error'?
Do pointers need to be initialized?
What are formal parameters?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
List the difference between a While & Do While loops?
What is c standard library?
Differentiate between the = symbol and == symbol?
Which built-in library function can be used to match a patter from the string?
What is void pointers in c?
Why do we use static in c?
Can the sizeof operator be used to tell the size of an array passed to a function?
What is wild pointer in c with example?