I have a question on return and recursive functions.
This is again based off of a binary Tree which I am currently working on. The code is
void Tree::display()
{
if( !root_ )
return;
display_r(root_);
}
void Tree::display_r(Tree *node)
{
if( 0 == node )
return;
display_r(node->left_);
std::cout <<...
I am trying to pass a coordinate, which is defined as struct with 2 integer parameters (the struct is called coord) the following way:
UpdateB({0,0});
where the input argument is of type coord (i.e. in the above statement I am trying to pass a coordinate 0,0). UpdateB is some function. I am getting an error, any ideas what
the probl...
Hello
i have a a char array in C++ which looke like {'a','b','c',0,0,0,0}
now im wrting it to a stream and i want it to appear like "abc " with four spaces insted of the null's
i'm mostly using std::stiring and i also have boost.
how can i do it in C++
basicly i think im looking for something like
char hellishCString[7] = {'a','b'...
Our C++ application hosts Sun's JVM and I need to upgrade it to the newest version on Windows. I downloaded JDK 6u20, but I have no idea which folders to take into our installation. We currently have some version of Java 5 but it seems that whoever did it in the first place, cherry picked the files.
I'd like to know which folders to tak...
I have a web server which receives an image from a client and do some SIFT based image matching at the server (win32) end send the result back to the client.
Receiving image is done using apache and php. SIFT based processing functions are in C++. Now I want to parse the data in php variable $image (the variable which holds the received...
Hi,
How can I get the sector size for floppy and CD disks in Linux, via C++ code?
Thank you all.
...
Is there someone that knows what is the computational cost for this two piece of code?
while(n>2)
n = sqrt(n);
while(n>2)
n = log(n)
...
In c lets say we have 2 files
1.h
#include<2.h>
blah blah
and we have
2.h
#include<1.h>
code
How is this resolved??
...
My question is in the context of Code::Blocks and its tweaked version of MinGW, and Notepad++ .
I want to be able to include Unicode literals in my source, and I can, so long as I use UTF-8 and not use a BOM.
This works fine, up to a point, but it BOMs out (bad pun) whenever I reopen the file; it (not surprisingly) has this un-nerving ...
What im trying to do is have a table which does not appear editable directly but can be edited in some widget outside the table. That is, the selected node can be edited here, and all nodes use the same editor because i want it to always be shown.
What I've tried is to subclass QItemDelegate and just return the instance of QTextEdit i a...
Hi, how can i get data prgogrammaticaly from windows registry MRU list? I am using vc++. For example windows xp search history is located in Software\Microsoft\Search Assistant\ACMru\5603. How can i get data from it?
EDIT:I still dont know howto do this, can you be more specific? So what steps do i need to do to have acess to data?
...
hey guys
This code compiles fine in Vc++ but in borland c++ gives me this error.. Please help me out..
The code has no syntax errors and works fine.. Seems like there is a problem with the header.. But these are the standard headers and library files
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
main.c:
Error E2337 c:\Bor...
I have created a GUI which requires .dll files in order to work. Here the list of those:
mingwm10.dll libgcc_s_dw2-1.dll
QtCore4.dll QtGui4.dll
I have read that I should write
CONFIG += static
in .pro file. But it does not work. Could you help?
...
How to make Esc key to minimize a dialog? By default it closes. Should I process KeyEvent or there is a better way?
...
Hello StackOverflow!
im trying to serialize some object as xml and then read it back
the code is:
IncomingTradeMessage inherits BaseMessage and contains InternalRequestInfo which in turn contains InternalTradeTransInfo. this is the code:
std::ostringstream oStringStream;
boost::archive::xml_oarchive xmlArchive(oStringStream);
xmlArch...
We're getting some funny behavior in the Visual Studio debugger with the following.
I'm not sure if it's the code or some debugger weirdness (seen stuff like it before).
We are trying to return a pointer to an value in an array.
The weird behavior is that the value of x changes to equal y after func() is called a second time...at least,...
Suppose I have a class with private memebers ptr, name, pname, rname, crname and age. What happens if I don't initialize them myself? Here is an example:
class Example {
private:
int *ptr;
string name;
string *pname;
string &rname;
const string &crname;
int age;
public:
E...
Hi,
I've been using libxml2 push parsing (SAX) to parse an incoming XML stream, this works well first time but crashes on the second attempt every time, my code looks like this:
xmlSAXHandler saxHandler;
memset(&saxHandler, 0, sizeof(m_SaxHandler));
xmlSAXVersion(&saxHandler, 2);
saxHandler.initialized = XML_SAX2_MAGIC; // so we do th...
Well that may sound like a troll question, but since C++ seems hard to fully master (and I never really knew STL was actually "part" of it), I wanted to know what are the disadvantages to use C instead of C++ when not relying much on OOP.
C++ can have a very much sophisticated syntax sometimes, which is kinda confusing me while trying t...
Hi, how can i get the windows search history and use it in my program? For example i write ".doc" in windows search bar. Now i want in my program to find out from somewhere, that i searched for ".doc" in my system(not web). How can i do this?
...