Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #55.0K
~352 People Reached
Favorite Forums
Favorite Tags
c++ x 3

2 Posted Topics

Member Avatar for denethor

[QUOTE=denethor;1750062]Hello, I have this code: [CODE] #include <iostream> #include <string> void main() { std::string a = "Sample"; printf("%s", a); std::cin.get(); } [/CODE] and it prints some I think random letters. Where i made mistake? And how should i change the code to write "Sample"? Thanks for answers and sorry for …

Member Avatar for denethor
0
215
Member Avatar for massivefermion

[QUOTE=pywriter;1750029]I wanna know how can I read a string from input which contains spaces and by string,I mean a string class object. thanks[/QUOTE] Use the getline() function. For instance, if you have [CODE]string str;[/CODE] then use [CODE]getline(cin, str);[/CODE]

Member Avatar for phil_alloy
0
137

The End.