示例#1
0
int main(int argc, const char * argv[])
{

    Hello *h = new Hello();
    h->sayHello("ZhangSan");
//    std::string name = "ZhangSan";
//    h->sayHello((char*)name.c_str());
    
    
    // insert code here...
    std::cout << "Hello, World!\n";
    return 0;
}
示例#2
0
文件: main.cpp 项目: output/CPPLesson
int main(int argc, const char * argv[])
{

    Hello *h = new Hello();
    
//    C写法
//    h->sayHello("Lance");
//    std::string name = "Lance";
//    转成C类型的字符串,这样就不会警告了。
//    h->sayHello((char *)name.c_str());
    
//    C++写法
    h->sayHello("Lance");
    
    
    
    
    return 0;
}
示例#3
0
int main(int argc, char const *argv[]) {
	Hello hello;
	std::string msg = hello.sayHello();
	std::cout << msg;
	return 0;
}
示例#4
0
int main(int argc, char ** argv) {
    Hello hello ("Pepito");
    hello.sayHello(10);
    return 0;
}