C++ get description of an exception caught in catch(...) block
Hi, can I get description of an exception caught by catch(...) block? something like .what() of std::exception. ...
Hi, can I get description of an exception caught by catch(...) block? something like .what() of std::exception. ...
i have following code #include <boost/date_time/posix_time/posix_time.hpp> #include <iostream> #include <boost/asio.hpp> using namespace std; int main(int argc,char *argv[]) { boost::asio::io_service io; boost::asio::deadline_timer t(io,boost::posix_time::seconds(5)); t.wait(); std::cout<<" hello world\n"; return ...
Hi, I've declared a uint8 variable and when the value in it is printed, I get smiley faces and white spaces. Shouldn't it display integer values? ...
i am using visual c++ 2010 in win7 i have following code #include <iostream> #include <boost/asio.hpp> #include <boost/date_time/posix_time/posix_time.hpp> int main(){ boost::asio::io_service io; boost::asio::deadline_timer t(io,boost::posix_time::seconds(5)); t.wait(); std::cout<<"hello world"; return 0; } but ...
#include<stdio.h> int main(void) { int a[3] = {1,2,3}; printf("\n\t %u %u %u \t\n",a,&a,&a+1); return 0; } Now i don't get why a and &a return the same value, what is the reasoning and the practical application behind it? Also what is the type of &a and could i also do &(&a) ? ...
Hi, i am new to C++ I am creating a custom QList of type Account* called AccountList through inheritance. My interface declaration for AccountList is as follows: class Client { public: Client(QString firstName, QString lastName, QString address1, QString address2, QString postalCode); QString toString(); priva...
I'll looking for advice/resources to write a program that can intercept system calls from a programm to supervise it's filesystem, network, etc access. The aim of this is to write an online judge, so that untrusted code can be run safely on a server. This is on linux, and I would prefer to write C++ or a scripting langauge (ruby, pytho...
hello i have a problem i am trying to convert a string like "12314234" to int so i will get the first number in the string. from the example of string that is shown above i want to get '1' in int. i tried : string line = "12314234"; int command = line.at(0); but it puts inside command the ascii value of 1 and not the number 1. thanks in...
From the book Exceptional C++ Solution to ch. 44 I've learned that they are situations when none of the new cast styles would work properly. I always thought that they (those 4 new casts) cover every possible situation and there is no need for "old" style cast anymore, but it appears to be not true. So my question is: Are those new casts...
i have posted this question third times please help i have following code #include <iostream> #include <boost/asio.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/filesystem.hpp> #include <boost/system/windows_error.hpp> using namespace boost::system; int main(){ boost::asio::io_service io; boost::as...
Hi, I am trying to add two Vectors below is the code snippet :- #include <iostream> #include <vector> using namespace std; int main() { unsigned int i = 0; vector <float> v1; vector <float> v2; vector <float> v3; cout << "Filling the Numbers\n"; for (i=5;i < 125 ; i = i + 5) { ...
I've modified James' flattening iterator to act as a bidirectional iterator if possible, but I don't think my changes are very elegant (particularly relying on a bool to see if the inner iterator has been set). However, I can't seem to come up with a nicer solution. Does anyone have any ideas? #include <algorithm> #include <iostream> ...
This is a very abstracted explanation of what I'm doing: Say I have a text file full of numbers separated by newlines. Right now, I take these numbers and put them in a map<int, int>, where the key is the number, and the value is the frequency. My end goal is a list of numbers sorted by frequency. How can I go about doing this? Note th...
Hi. I have this code. I would like to put argv[1] as prefix to fileName. How do I do that? int _tmain(int argc, char** argv) { ... _stprintf(fileName, _T("%04d-%02d-%02d-%02d-%02d-%02d-%03d.jpeg"), lt.wYear, lt.wMonth, lt.wDay, lt.wHour, lt.wMinute, lt.wSecond, lt.wMilliseconds); ...
This is a code sample copied from chapter 17 as bellow. When I compile it with Visual Studio 2008, it keeps this error: warning C4346: 'HashMap::mapped_type' : dependent name is not a type 1> prefix with 'typename' to indicate a type Does anyone has any idea about this? Thanks in advance! #include <vector> #include <map> using...
We all know how sparsely documented Objective-C++ is. I can't find anything on this, but I'm also finding it hard to find suitable unambiguous search terms. So, Stackoverflow to the rescue (I hope)! I have a C++ class that I have an instance of within an Objective-C(++) class (and I have the project setting enabled for constructors/ des...
Hi, I saw below thing about switch statement in c++ standard $6.4.2. Switch statement can take a condition. The condition shall be of integral type, enumeration type, or of a class type for which a single conversion function to integral or enumeration type exists (12.3). If the condition is of class type, the condition is converte...
Hi! I'm going to use enum flags for options to initialize my class. The enum is: namespace MCXJS { enum VARPARAM { STATIC = 1, CONST = 2 } //other things } If I'm right, in this case, to check for STATIC I need to do this: if (param & MCXJS::VARPARAM::STATIC) //... I know to do it this way: if (par...
Possible Duplicate: Incorrect floating point math? Using C++ console app in visual studio. float percentCorrect; percentCorrect = ( 7 / 5 ); printf("%f", percentCorrect); output is 1.0000 OK so how do I get the correct decimal output?? ...
Does anyone have a C++ Object interface for the S4 server? ...