summaryrefslogtreecommitdiff
path: root/CPP/cpp_book/chap1/1_2.cpp
blob: b9142710ef84ce676a4c4262bea736a1c59a5131 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include <string>

int
main()
{
	std::cout << "Enter your first name: ";
	std::string name;
	std::cin >> name;

	const std::string greeting = "Hello, " + name + "!";

	const std::string spaces(greeting.size(), ' ');
	const std::string second = "* " + spaces + " *";
	const std::string first(second.size(), '*');

	std::cout << msg << std::endl;

	std::cout << std::endl;	// Flush stdou buffer

	std::cout << first << std::endl;
	std::cout << second << std::endl;
	std::cout <<"* " + greeting + " *" << std::endl;
	std::cout << second << std::endl;
	std::cout << first << std::endl;
}