c++

Are you aware of any lexical analyzer or lexer in Qt?

Are you aware of any lexical analyzer or lexer in Qt? I need it for parsing text files. ...

segfault when trying to access a string member of a class

I have a class Message that has a std::string as a data member, defined like this: class Message { // Member Variables private: std::string text; (...) // Member Functions public: Message(const std::string& t) : text(t) {} std::string getText() const {return text;} (...) }; Thi...

How do I concurrently download and convert a binary file using threads?

I have a program that downloads a binary file, from another PC. I also have a another standalone program that can convert this binary file to a human readable CSV. I would like to bring the conversion tool "into" the download tool, creating a thread in the download tool that kicks off the conversion code (so it can start converting whi...

(C++)Code:: blocks does not recognize QT4 classes

So far I have worked in the console and a few days ago decided to try the QT GUI. I downloaded the QT SDK , install it, adjust the location of QT and set up the PATH Environment Variable -> per the instructions on the site. I opened a new Qt4 project in Code:: Blocks-in and it seemed that everything was OK. There is by default an exampl...

Suitability of C# for clustered calculation-heavy apps?

I'm preparing to write a photonic simulation package that will run on a 128-node Linux and Windows cluster, with a Windows-based client for designing jobs (CAD-like) and submitting them to to the cluster. Most of this is well-trod ground, but I'm curious how C# stacks up to C++ in terms of real number-crunching ability. I'm very comfort...

Implementing a Windows Explorer extension view interface

I have a Visual Studio 2008 C++ ATL project that is a namespace extension for Windows Explorer. In the tool bar rebar for Windows Explorer in Windows XP, there is an icon labeled "views". In a normal view, it creates a drop-down menu that allows the user to select "Thumbnails", "Tiles", "Icons", "List", or "Details" as the view type. ...

Expected specifier-qualifier-list before... Error in C++/Objective-C iPhone project

So I'm going through the first tutorial in O'Reilly's iPhone 3D Programming book. At this point in the tutorial, it pulls all the OpenGL ES stuff into a seperate c++ interface. I have followed the book to the letter, as far as I can tell, yet I can't seem to figure out this compiler error. I'm fairly new to C++ (mostly C# in the past), s...

Recommendations for Secure TCP Connections For Consumer Application

I'm designing a training program in C++ that will be distributed to a large number of facilities, most of which won't have much in the way of an IT staff. The program connects via a TCP connection to a central database which stores various pieces of data for research and evaluation purposes. The problem I have is that I would like to ma...

interface forwarding from member variable using C++ templates

How do I say: template<typename T> class X { // if T has method x(), define // Y x() { return t.x() } T t; }; ...

stating jmp_buf as pointer

I'm tring to define jmp_buf as pointer and using it in nested longjmp(s).as follow: ... jmp_buf *bfj; ... and then writing if else: if( setjmp(*bfj) == 0){ DS[SP-2].int_val=(int)bfj;; //to store the bfj }else {} and somewhere else using the stored bfj to longjmp bfj = (jmp_buf *)DS[TOP].int_val; longjmp(*bfj,1); where DS[TOP]...

Log4cxx configuration of appender

Hello, I use the library log4cxx in a c++ cross-platform project. We decide to use configuration file in XML. I have three questions: i use simple appenders of type "org.apache.log4j.FileAppender" for some loggers with the same layout. But i want that the loggers write in different files. I created some appenders with different name ...

ld doesn't recognize object file

I'm having problems with compiling a project I'm working on. Everything else works just fine, but when I compile, I get this error message: /usr/bin/ld:obj/content/xmSound.o: file format not recognized; treating as linker script I have no idea why this happens. It's probably some error in the code, but I don't know. The source file xm...

Are there issues loading multiple mscvrt**.dll versions?

Hello, I have been unable to find much or any information on this. I have a project which is built using VS2005, thus using the mscvr80.dll. My project also loads a third party library, which then loads up mscvrt60.dll. Now I have a strange bug in my program where the program crashes with a memory read violation (in debug it is at 0xc...

Is there a C++ equivalent to Java's Collection interface for STL container classes?

I would like to pass arbitrary container as an argument of function and iterate over it (no erasing nor pushing elements). Unfortunately it looks like there is no standard way of doing this. First solution which comes to my mind is an interface (let's call it CollectionInterface) implemented by classes that will wrap STL containers. so...

How to order a string[] in c++

The input is string[] like below. "CSE111: CSE110 MATH101" "CSE110:" I need to order the strings based on some logic. For example my output should be a string[] like "CSE110","MATH122","CSE111" My question is While scanning through the input array, if one string is picked to be the first string of the output array, ...

Sending char ** data types to device

Hi, heres sumthin ive been battling for 4 days now. I have an array of character pointers which i want to send to device. Can somebody tell me how... Heres what ive tried so far: char **a; char **b; *a[0]="Foo1"; *a[1]=="Foo2"; cudaMalloc(void**)?,sizeof(?); cudamemcpy(b,a,sizeof(?),cudaMemcpyHostToDevice); How do i pass in the param...

"Selected" style for WinAPI toolbar button?

Is there a way to make a toolbar button look different than the rest (Aside from changing bitmap or setting its state to Disable? Is there away to make it look highlighted all the time? I want the selected tool to look selected. Thanks (Sort of like the way open applications are "Selected" in Windows 7. ...

С++ TYPE CASTING

Hello there, i have very low C++ experiences and i need little help in casting a type. I actually in a big dependence for that cast, need it rly hard. So ... I have this types : typedef short DCTELEM; typedef DCTELEM DCTBLOCK[64]; Array of last type and a pointer to a malloc'ed array of shorts: DCTBLOCK MQUAD; short * ptrArray; ...

Boost.Python on Mac OS X: "TypeError: Attribute name must be string"

Hello all, I recently installed Boost using MacPorts, with the intent to do some Python embedding in C++. I then decided to check if I configured Xcode correctly with an example found on Python's website: #include <boost/python.hpp> using namespace boost::python; int main( int argc, char ** argv ) { try { Py_Initial...

Is there a thread safe queue class for Visual Studio C++ 6.0?

I would like to implement a thread safe queue in VS 6.0 Is there a good class to use for this? This is an MFC application using the CWinApp. My former post lead me to here but I don't have the luxury to code in VS 2010, stuck in 6.0 land. o well..... Thank You. ...