summaryrefslogtreecommitdiff
path: root/3p7.cpp
blob: 9acc8fb6191efdf4159aed12d54569c3daeb8d79 (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
27
28
29
30
#include <iostream>
#include "sales_data.hpp"
#include "sales_item.hpp"

/*
 *
 * 3.7
 *
 * Nothing different happens, pretty much same result. Though auto might just be better so we are sure what type it is.
 * Unless the author meant that we were supposed to do char rather than (char&). If we were to just do 'char' type then
 * we wouln't be able to modify the characters in the string, therefore the string remains unchanged.
 */

using std::string;
using std::cout;
using std::cin;
using std::cerr;
using std::clog;
using std::endl;
int main () {

    string Xer;
	cout << "Enter a string" << endl;
	cin >> Xer;
	for(char &c : Xer) { // Make reference for every character in Xer
		c = 'X';
	}
	cout << Xer << endl;
	return 0;
}