is windows.h really necessary? As far as I know std::system is a C++ function that communicates with the terminal at hand. I do not run windows, would you mind trying? I am interested? For me using xterm on Linux mint x64:
1 2 3 4 5 6 7 8 9
#include <cstdlib>
#include <iostream>
int main()
{
std::cout << "We will not see this string for long!\n";
std::system("clear");
std::getchar();
}
no you can't use std::sytem and I have never heard of it being part of the std class and when I am on linux I don't need to use std::system it's just system() and windows.h is required on windos for anything that uses the windows api I am pretty sure of
Yes,it is necessary. I don't know about Linux but on windows you must include "windows.h".
But I am curious though c++ STL is supposed to be standard so how can it has a function on Linux but not on windows ?
It worked. windows.h isn't necessary and you can use std::system on windows.Thanks for the new info !!
Yes,it is necessary. I don't know about Linux but on windows you must include "windows.h".
Who says windows.h is necessary, windows.h may have additional namespace function that performs the same operation, but the standard library that embeds system() functions is the cstdlib.
BeastlyHex wrote:
Im New To C++ And When I Open The File The Window Just Opens And Closes. Ive Been Told To use pause but i dont know where to use it in my code HELP
Help has been on the first page ever since the opening of this website(who told me?), and its been the second post on the page, beautiful comments are there on how "efficiently" you can tackle that problem.
Who says windows.h is necessary, windows.h may have additional namespace function that performs the same operation, but the standard library that embeds system() functions is the cstdlib.
Nice I didn't know that , but I don't actually use c-like functions much.