Lately I have been searching this post on the net about graphics.h in dev c++ and found few resources about it . So I decided to write how to use graphics.h in dev-c++. I am expecting that you have already installed bloodshed dev-cpp on your machine. Graphics.h is a header file found in borlan c [...]
Archive for the ‘C++’ Category
Hello World in C++
//Printing Hellow World! #include <iostream> int main() { std::cout << “Hello World! \n”; system(“pause”); return 0; } Line begins with //, indicating that the remainder of the line is a comment. Programmers insert comments to document programs and also help people read and understand them. Comments do not cause the computer to perform any action [...]
Hello World in C++
#include // I/O library using namespace std; int main() { cout << “Hello, world!” << endl; } The // symbol is used as a rest-of-line comment symbol. Also, the program text can be placed in any position on the page, with white space between tokens being ignored. White space are characters such as blanks, tabs, [...]
C++ Reading From a Text File
#include <iostream> #include <fstream> #include <string> using namespace std; int main() { string line; int count = 0; ifstream FileName (“try.txt”); if (FileName.is_open() && !FileName.eof()){ while (getline(FileName,line)){ count++; } } else cout << “Error opening file!” << endl; cout << “The number of lines in the file is ” << count << endl; system(“pause”); } [...]






