I am a beginner of C++;
I have a question about the std:string and std:cout class;
Two pieces of code:
--------------------------------
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1 = "Hii";
string s2 = "MSDN Fans!\n";
cout<<s1+s2;
}
---------------------------------
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1 = "Hii";
string s2 = "MSDN Fans!\n";
string s3 = s1 + s2;
cout<< s3;
}
Which one would be run faster or they'r totally the same.Is there any
method for measuring the efficiency of programs?