Write a String class which has: 1) default constructor 2) copy constructor 3) destructor 4) equality operator similar to strcmp 5) constructor which takes a character array parameter 6) stream << operator
2 9036What is the output of: String a1 = "Hello"; String a2 = "world!"; String* s1 = &a2; String& s2 = a1; s1 = &a1; s2 = a2; std::cout << *s1 << " " << s2 << std::endl;
4 9030Is there any difference between dlearations int* x and int *x? If so tell me the difference?
16 30232whats the size of class EXP on 32 bit processor? class EXP { char c1; char c2; int i1; int i2; char *ptr; static int mem; };
5 10828If P is the population on the first day of the year, B is the birth rate, and D is the death rate, the estimated population at the end of the year is given by the formula: The population growth rate is given by the formula: B – D Write a program that prompts the user to enter the starting population, birth and death rates, and n, the number of years. The program should then calculate and print the estimated population after n years. Your program must have at least the following functions: 1. growthRate: This function takes its parameters the birth and death rates, and it returns the population growth rate. 2. estimatedPopulation: This function takes its parameters the current population, population growth rate, and n, the number of years. It returns the estimated population after n years Your program should not accept a negative birth rate, negative death rate, or a population less than 2.
1 6120Post New C++ General Questions
What is size_type?
What is the difference between strcpy() and strncpy()?
What are the uses of pointers?
What are put and get pointers?
What is a namespace in c++?
How do you find out if a linked-list has an end? (I.e. The list is not a cycle)
What is the difference between a type-specific template friend class and a general template friend class?
What is one dimensional array in c++?
Difference between pass by value and pass by reference?
Explain the difference between class and struct in c++?
What is the two main roles of operating system?
What do you mean by function overriding & function overloading in c++?
What do you mean by vtable and vptr in c++?
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?
Why cstdlib is used in c++?