Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Which of the following would assigns the string “welcome” to the second constructor? - Select

  Shared By: Klarissa Schmidt    Date: Nov 20    Category: C++ Programming    Views: 1548

Answer:

Consider the following code segment:

class simple
{
int a,b;
public:
simple();
simple(char[]);
};

Which of the following would assigns the string “welcome” to the second constructor?

a) simple s(“welcome”);
b) simple s(welcome);
c) simple s=”welcome”;
d) None of the above

Answer : a) simple s(“welcome”);

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: