Skip to content

Instantly share code, notes, and snippets.

@yifu
Created September 21, 2012 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yifu/3762202 to your computer and use it in GitHub Desktop.
Save yifu/3762202 to your computer and use it in GitHub Desktop.
#include <iostream>
int main()
{
char pre [4] = "123";
char buf [4] = "123";
char post[4] = "123";
std::cin.width(3);
std::cin >> buf;
std::cout << pre << "," << buf << "," << post << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment