title: How do I insert a variable result into a string in C++
body: <p>I just started learning C++ in Qt and I was wondering how can I put a variables result in a string? I'm trying to use this for a simple application where someone puts their name in a text field then presses a button and it displays there name in a sentence. I know in objective-c it would be like,</p>
  
  <pre><code>NSString *name = [NSString stringWithFormatting:@"Hello, %@", [nameField stringValue]];
  [nameField setStringValue:name];
  </code></pre>
  
  <p>How would I go about doing something like this with C++? Thanks for the help</p>