Category : short

If I set "short enum" like true (project->options->c++ compiler), I receive access_violation in return from function where std::ofstream is used. Example code: #include <iostream> #include <fstream> void __fastcall TForm1::FormCreate(TObject *Sender) { AnsiString textFile = "err.txt"; std::ofstream out; out.open(textFile.c_str()); out<<textFile.c_str(); out.close(); } Somebody know how to set short enum for all project like true and still ..

Read more

If I set "Short enums" to true (Project -> Options -> C++ Compiler), I receive an Access Violation in return from a function where std::ofstream is used. Example code: #include <iostream> #include <fstream> void __fastcall TForm1::FormCreate(TObject *Sender) { AnsiString textFile = "err.txt"; std::ofstream out; out.open(textFile.c_str()); out << textFile.c_str(); out.close(); } Does anyone know how to ..

Read more

#include <iostream> #include <climits> int main(void) { std::cout << SHRT_MIN << std::endl; std::cout << SHRT_MAX << std::endl; //-32768 ~ 32767 is the range short a; std::cin >> a; std::cout << “decimal: ” << a << std::endl;//decimal return 0; } Look at the above code used to observe what happens when I enter an integer outside ..

Read more