Tags » 2

Easy 2

.h

#include <iostream>
#include <string>
#include <fstream>

int main() {
	std::string name = "unknown";
	std::string username = "unknown";
	int age = 0;

	std::cout << "What is your name: ";
	std::cin >> name;
	std::cout << "How old are you?: ";
	std::cin >> age;
	std::cout << "What is your username?: ";
	std::cin >> username;
	
	std::ofstream myfile;
	myfile.open("sample1.txt");
	myfile << "Your name is "<< name
			   << ", you are " << age << " years old, "
			   << "and your username is " << username << std::endl;			   
	myfile.close();
	
	std::cout << "Reading file..." << std::endl;
	std::string line;
	std::ifstream read_my_file;

	read_my_file.open("sample1.txt");
	if (read_my_file.is_open()) {
		while (std::getline(read_my_file, line)) {
			std::cout << line << std::endl;
		}
		myfile.close();
	}
} 241 more words
Code

Ode to the Book (I) (or) Ode to the Book (II)

Go to sleep                        Go to sleep
with the dawn                         with the whole (entire) night
and wakes (up,) singing        and wake(s) singing
with the dawn.

Poetry Chapbook

No Light

The grimy smoke clouds the soul

Storming the determination of your role

Making you doubt, making you shout

__

Darkness rains over your skin, seeps in… 21 more words

Poems