Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

You must login to add post.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

mcqoptions.com

mcqoptions.com Logo mcqoptions.com Logo

mcqoptions.com Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/Pointers
  • Recent Questions
  • Most Answered
  • Answers
  • No Answers
  • Most Visited
  • Most Voted
  • Random
Vineeta Ghanshyam Jhaveri
Vineeta Ghanshyam Jhaveri
Asked: 3 years agoIn: Pointers

Write a function substr() that will scan a string for the occurrence of a give substring. the prototype of the function would be:

char *substr(char *string1,char string2);

The function should return a pointer to the element in string1 where strig2 begins. If string2 doesn’t occur in string1 then substr() should return a NULL.

For example, if string1 is “Ena Meena Deeka”, and string2 is “Meena” the substr() should return address of ‘M’ in string1. 

Write main() function also that uses the function substr().

Waves
  • 0
  • 1
  • 6
  • 0
Bhaagyasree Bawa
Bhaagyasree Bawa
Asked: 3 years agoIn: Pointers

What is the advantage of passing arguments by reference? When and why is passing an object by reference preferable? 

Waves
  • 0
  • 1
  • 10
  • 0
Yash Majumdar
Yash Majumdar
Asked: 3 years agoIn: Pointers

Write a function having this prototype:

int replace(char *s,char c1,char c2); Have the function replace every occurrence of c1 in the string s with c2, ad have the function return the number of replacements it makes.

Waves
  • 0
  • 1
  • 5
  • 0
Monin Singh Mani
Monin Singh Mani
Asked: 3 years agoIn: Pointers

Given here is a structure defilation:

struct Box {  char maker[21];

float height,width,length,volume;

};

Write a function that passes the address of a Box structure and that sets the volume member to the product of the other three dimensions.

Waves
  • 0
  • 1
  • 7
  • 0
Megha Krishnamurthy
Megha Krishnamurthy
Asked: 3 years agoIn: Pointers

C++ lets you pass a structure by value and it lets you pass the address of a structure. If sample is a structure variable, how would you pass it by value? How would you pass its address? Which method do you think is better?

Waves
  • 0
  • 1
  • 4
  • 0
Ekbal Chandra Kara
Ekbal Chandra Kara
Asked: 3 years agoIn: Pointers

Imagine a publishing company that markets both books and audio-cassette versions of its works. Create a class called Publication that stores the title (a string) and price of a publication. From this class derive two classes: Book, which adds a page count (type int); and Tape, which adds a playing time in minutes (type float). Each of the three class should have a getdata() function to get its data from the user at the keyboard, and a putdata() function to display the data. Write a main() program that creates an array of pointers to Publication. In a loop, ask the user for data about a particular book or Tape, and use new to create a object of type Book or Tape to hold the data. Put the pointer to the object in the data for all books and tapes, display the resulting data for all the books and taps entered, using a for loop and a single statement such as

pubarr[i]->putdata();

to display the data from each object in the array.

Waves
  • 0
  • 1
  • 4
  • 0
Umesh Savant
Umesh Savant
Asked: 3 years agoIn: Pointers

Suppose 7 names are stored in a array of pointers names[] as shown below:

char *names [ ]= { “Anand”,”Naureen”,”Banjot”,”Wahid”,”sheena” }; 

Write a program to reverse the order of these names.

Waves
  • 0
  • 1
  • 15
  • 0

Sidebar

Ask A Question

Stats

  • Questions 500k
  • Answers 393k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Aditi Dugal

    How to approach applying for a job at a company ...

    • 7 Answers
  • Raghavan Prasad Hayer

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Ankita Dinesh Biswas

    What is a programmer’s life like?

    • 5 Answers
  • 47e0c
    47e0c added an answer Correct Answer - Increasing the yield of animals and improving… November 12, 2022 at 9:56 am
  • b6699
    b6699 added an answer Sender\'s addressDateReceivers name and addressSubjectContentYours faithfullyName November 12, 2022 at 9:56 am
  • 10eb8
    10eb8 added an answer Any uncertinity in measurment is known as errorDifference in true… November 12, 2022 at 9:56 am

Top Members

Trending Tags

Class 11 Parabola Polity Polynomials Probability Projectile Protists Quadrilaterals Rario Reasoning Sampling Social Solutions Spectroscopy Switchgear Thermodynamic Tourism Transients Upsc Wbjee

Explore

  • Home
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Tags
  • Badges
  • Users

Footer

mcqoptions.com

About

MCQOptions.com

Here are the top interview questions, example answers, tips for giving the best response.

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Follow

© 2022 MCQOptions. All Rights Reserved