I have been searching around on the web for a long time and can't find out how to print using c++. Although there are some pages explaining how to do this, but they are complex, a lot of them using graphics. I just wan't to print plain text. As i'm writing a cash regiter program and want to be able to print reciepts.
please note im not using a ltp printer im using a networked one
cout prounounced (see-out) is the print command. I believe you can only use this when u call the iostream in ur header. so for example
#include <iostream>
using namespace std;
int main() {
int x = 5
cout<<"Hello World"<<" I just went down a line with the following two characters\n";
cout<<x<<" "<<"Printed out variable x"<<endl;
}
you need to add endl at the end to print out everything.
i knew how to connect the cout to the printer... but since my book got lost and i never used this (only once for testing issues) i forgot that detail...
but i did try to google it and there are a lot of examples that work other ways...