I created a new project with the following code segment:
char* strange = "(Strange??)";
cout << strange << endl;
resulting in the following output:
(Strange]
Thus translating '??)' -> ']'
Debugging it shows that my char* string literal is actually that value and it's not a stream translation. This is obviously not a meta-charac...
can any one help me with code that subtract 1 from a digit stored in an array using c++ (elementary mathematics)
eg..
100-1=99
and
98-1=97
...
So I downloaded the zip file from the curl website. I copied the directory with all of the header files into my include directory. Including the curl.h works with no problems, however, when I go to actually call a function, suddenly my c++ app will no longer compile.
Here's the error I'm receiving:
[Linker error] undefined referenc...
I've seen at least one reliable source (a C++ class I took) recommend that application-specific exception classes in C++ should inherit from std::exception. I'm not clear on the benefits of this approach.
In C# the reasons for inheriting from ApplicationException are clear: you get a handful of useful methods, properties and constructor...
I want a tab control to "dock" to the entire window panel, in Qt Creator. Now in Winforms and WPF this is super easy but in Qt its not working.
I've tried all the layouts, grid layouts, etc etc. it's just shrinking the tabs not making them grow to fill. So please test a solution before telling me what the SHOULD BE OBVIOUS answer is c...
Using VS 2008, C++. I would like to delete all my pch's on a rebuild/build clean. Is there anyway I could add the *.pch files to the list of files to be deleted build->clean or rebuild all? I've looked through Visual Studio options dialog and really can't find anything. Has anyone messed with this in the past?
...
How do I stop automake from adding -I. to my compile line?
It seems automake or libtool objects always have a compile command similar to:
g++ -DHAVE_CONFIG_H -I. -I./proj/otherdir -o myprog.o myprog.c
The problem is that I have two header files with the same name....
./proj/otherdir/Header.h
./proj/thisdir/Header.h
Each header has...
Hi there. I need to write an ActiveX control and have never written one before.
I'd appreciate being pointed to some useful tutorials.
I'm also wanting to implement it under Code::Blocks. Has anyone done this before? how easy is it?
Note: I've found a number of tutorials, but they are either for visual basic, or visual c++ based. ...
Hello,
I'm trying to print characters in the console at specified coordinates. Up to now I have been using the very ugly printf("\033[%d;%dH%s\n", 2, 2, "str"); But I just had to ask whether C++ had any other way of doing this. The problem is not even that it's ugly, the problem comes up when I try to make myself a prettier function lik...
I'm sure this is on the web somewhere, but I'm having trouble with the search terms (getting lots of non-relevant stuff.) Anyway, I've got a Direct3D9 application. When it runs in full screen, on Vista and Windows 7, and you hit Alt-Tab or Win-Tab, my application just shows up blank in the thumbnail/preview/live view (not sure of the cor...
I'm using a boost typelist to implement the policy pattern in the following manner.
using namespace boost::mpl;
template <typename PolicyTypeList = boost::mpl::vector<> >
class Host : public inherit_linearly<PolicyTypeList, inherit<_1, _2> >::type
{
public:
Host() : m_expensiveType(/* ... */) { }
private:
const ExpensiveType m...
I'm running valgrind 3.5.0 to try and squash memory leaks in my program.
I invoke it as so:
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes
After my program finishes valgrind reports that
==22926==
==22926== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1)
==22926== malloc/free: in use at exit: 20,862 ...
I am trying to integrate a non-Java executable into a Java webapp on the server-side (Linux).
Some details about the executable:
Written in C++. The executable takes some input either from stdin or file and generates an output file. The executable is not designed to be a long running process i.e it generates an output and then dies out...
I am merely trying to create a boost ip::tcp::socket from an existing native socket. In the assign function, the first parameter must be a "protocol_type" and the second must be a "native_type", but it never explains what these are or gives an example of its use.
I'm guessing the second should be the socket descriptor, but I'd really ap...
I've got a class I've written, and I'm trying to connect it to Qt. I've got some "best practices" questions I hope you all can help me with.
When creating a mainWindow to contain data, I inherit the header file into my custom class specified above, so I can make use of the elements created within Qt Creator. Is this the proper way of...
Hi all,
I am working to become a scientific programmer. I have enough background in Math and Stat but rather lacking on programming background. I found it very hard to learn how to use a language for scientific programming because most of the reference for SP are close to trivial.
My work involves statistical/financial modelling and ...
hi, im not a c/c+ programmer ( i do know delphi), anyway im trying to compile a program written in c++, i'v changed it to accept some arguments( a path to a file, which is hardcoded in the original code) from command line,
the orignial line was
char Filepath[50] = "F:\\mylib\\*.mp3";
and i changed it to
char Filepath[50] = argv[1...
I am trying to port/re-write GUI made using Nucleus Grafix to QT on Linux.In Nucleus code there is a control class which is the base class for the rest of the controls like Button,Editbox, radiobutton etc.This base class uses Nucleus API's and control structs to maximum.My question is whether to port/re-write the base class or make the c...
I need to write data into drive. I have two options:
write raw sectors.(_write(handle, pBuffer, size);)
write into a file (fwrite(pBuffer, size, count, pFile);)
Which way is faster?
I expected the raw sector writing function, _write, to be more efficient. However, my test result failed!
fwrite is faster. _write costs longer time.
I'v...
hi,
I have generated cppshared lib dll using matlab command mcc. Now I want this dll to make another dll inside microsoft visual c++. Is it possible to make a dll using another?
Please help!!
...