c++

C++ Overriding Methods

I can't figure out what is up with this. I have a Scene class that has a vector of Entities and allows you to add and get Entities from the scene: class Scene { private: // -- PRIVATE DATA ------ vector<Entity> entityList; public: // -- STRUCTORS --------- Scene(); // -- PUBLIC METHODS ---- void ad...

Speedup Matlab to C++ Conversion

Hey there I have some Matlab image processing code which runs pretty slowly and I'm prepared to convert it over to C/C++. I don't really know much about how matlab works and how code is executed but I'm just interested to hear what kind of speedups I might expect. Clearly there are many variables that will affect this but I'm just loo...

SSH connection in C++ under Linux

Hi. I am coding a simple networking tool in C++ that should be working under unix/linux operating systems. I need to make SSH connection in C++, i.e. C++ SSH client ? And don't forget - Linux, so don't point me to msdn. Thanks in advance. ...

selected Rows/Line in QTableView copy to QClipboard

Hi. First of all, sorry for bad English. It's about C++ and Qt. I have a SQLite-Database and I did it into a QSqlTableModel. To show the Database, I put that Model into a QTableView. Now I want to create a Method where the selected Rows (or the whole Line) will be copied into the QClipboard. After that I want to insert it into my OpenO...

MFC CEdit Ctrl Question

I have a CEdit control that I want to be able to take time input from. Now I want this input to come in the form hh:mm:ss. Currently I am using a separate CEdit control for hour, mins, & secs. I know I could require the user enter in colons to separate hours, mins, secs, but this I believe will get confusing for my users. I actually...

C++ : handle resources if constructors may throw exceptions (Reference to FAQ 17.4]

Hi, Thanks for all the response. I reformatted my question to understand the state of the member pointer after the containg class constructor throws an exception Again my example class :) class Foo { public: Foo() { int error = 0; p = new Fred; throw error; // Force throw , trying to understand what w...

std::sort and binary '=' operator issue with a C++ struct

Ok... I have this struct and comparison function- struct Edge { char point1; char point2; int weight; bool operator<( const Edge& rhs ) const { return( weight < rhs.weight ); } }; //end Edge bool compareEdge( const Edge& lhs, const Edge& rhs ) { return...

error: syntax error before '@' token (why?)

I include the amalgamation sqlite code in my iPhone project, and remove the reference to the iPhone sqlite framework. My main target compile fine. I have a second target for unit testing with the google framework. When compile I get: error: syntax error before '@' token I don't understand why. I have set both projects to sdk 2. ...

Non-destructible read from a stream.

Is is possible to try to read from a stream but do not change the stream itself (and return bool whether it was a success)? template <typename T> bool SilentRead (stringstream& s, T& value) { stringstream tmp = s; tmp >> value; return tmp; } This doesn't work because stringstream doesn't have public copy constructor. How t...

How does the compiler determine which member functions mutate?

A comment to one of my posts interested me: Me too. I also give accessors/mutators the same name. I was wondering about this, because I have always used setBar(int bar) instead of a mutator named the same thing. I want to know: can the compiler determine based on a const identifier what mutates at runtime, or can it use the same fu...

Build Error Makefile.win FLTK

I've got a GUI project (using Fast Light Toolkit) with the following components inside of it. All of the headers and files listed here (note the Makefile.win) http://www.stroustrup.com/Programming/Graphics/ and this is the file I'm trying to get to run. #include "Simple_window.h" // get access to our window library #include "Graph.h...

Static Pointer to Dynamically allocated array.

Hey, So the question is relatively straight forward, I have several semi-large lookup tables ~500kb a piece. Now these exact same tables are used by several class instantiations (maybe lots), with this in mind I don't want to store the same tables in each class. So I can either dump the entire tables onto the stack as 'static' members, ...

C/C++ documentation tool

What are the C/C++ documentation tools that you have used? Which one would you recommend? I have used doxygen with graphviz but it seems to have a problem with large code bases especially when generating collaboration diagrams. I found DoxyS on the web but have not used it. Going by the documention on its homepage it looks like its wor...

Can any one tell me how to write a simple C++ code to export my data(from variable) into PDF file without using any external libraries or utilities?

Can any one tell me how to write a simple C++ code to export my data(from variable) into PDF file without using any external libraries or utilities? ...

Load an X509 PEM file into Windows CryptoApi

Hi coders, I'm new to the whole Crypto thing, so I beg some basic pointers. I need to load .PEM (X509) "-----BEGIN RSA XXX KEY----- -----END RSA XXX KEY-----" into a Windows Crypto Api context to use with C++ (I found examples for Python and .NET but they use specific functions I can't relate to the plain Windows Crypto Api) I underst...

C++/CLI -- 0xc000007b (INVALID_IMAGE_FORMAT) with /clr option on

Hi; I'm trying to build a C++/CLI executable to which I statically link ffmpeg (libavcodec, libavformat, libavutil & swscale). It works fine if I build it normally (without /clr, so no CLR support), it works. However, when I add CLR support, it won't start up with a 0xc000007b. A "Hello World" C++/CLI app runs fine, though. Supposedly t...

Strange backtrace - where is the error?

Hi! I'm developing an image processing application in C++. I've seen a lot of compiler errors and backtraces, but this one is new to me. #0 0xb80c5430 in __kernel_vsyscall () #1 0xb7d1b6d0 in raise () from /lib/tls/i686/cmov/libc.so.6 #2 0xb7d1d098 in abort () from /lib/tls/i686/cmov/libc.so.6 #3 0xb7d5924d in ?? () from /lib/tls/...

Inheriting std::istream or equivalent

I need to bridge two libraries over a stream. QDataStream which is a stream from Qt and some function from another libraries that looks like this void read_something(istream& i); I have no control over how the QDataStream is created and I'm not allowed to change the interface of read_somthing function. The first thing I can think ...

How do I display more decimals in the output console?

I want to output the value of a double in it's full precision. However, when using the cout function, it only displays the first 6 digits even though there is around 15-16 digits of precision. How do i get my program to display the entire value, including the magnitude (power) component? Thanks in advance, -Faken ...

Why public ref in c++ class definition

Hi, First of all I want to make clear that 'm all new to C++, so this might be a simple and somewhat obvious question. In the C++ book I'm reading called C++ Primer, a class is defined by writing: class classname{ public: private: }; However, in VS2008 the compiler didnt like this. But by adding public ref before class, as in: pub...