I have two projects (x64).
A. Written in C (wxWidgets) --- edit: its in C++!
B. Written in C++
A compiles fine, but B (which uses functions of A) gives several errors when I try to compile.
I suggest that the reason for the errors is the same for all, so I mention only the first.
It says:
strlen: identifier not found
In the file...
I am using C++ boost's dynamic_bitset.
I have already allocated a variable and I just want to change its value - to construct it anew from an 'unsigned long' like from the constructor, but I don't want to allocate the memory again or to create a temporary variable.
What can I do?
...
class CRectangle {
int x, y;
public:
void set_values (int,int);
int area (void);
} rect;
In this example, what does 'rect' after the closing brace and between the semi-colon mean in this class definition? I'm having trouble finding a clear explanation. Also: Whatever it is, can you do it for structs too?
...
What are good introductions to the creation of C++ expression template systems? I would like to express arithmetic on user defined types while avoiding temporary values (which may be large), and to learn how to do this directly rather than applying an existing library.
I have found Todd Veldhuizen's original paper and an example from th...
I want to perform a printf() to display when the currently executing code was last compiled. Does C/C++ provide a macro that gives you that resolves to a timestamp during compilation?
...
I stumbled about a method which seems to be present in all DataObjects like QList, QQueue, QHash...
I even investigated so far i can see the source code of it, which is
inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
in qlist.h (lines 117)
but what effect does it have on the QList, QQueue,...
I have several chunks of PCM audio (G.711) in my C++ application. I would like to visualize the different audio volume in each of these chunks.
My first attempt was to calculate the average of the sample values for each chunk and use that as an a volume indicator, but this doesn't work well. I do get 0 for chunks with silence and differ...
This code is compiling clean. But when I run this, it gives exception "Access violation writing location" at line 9.
void reverse(char *word)
{
int len = strlen(word);
len = len-1;
char * temp= word;
int i =0;
while (len >=0)
{
word[i] = temp[len]; //line9
++i;--len;
}
word[i] = '\0';
}
...
I am currently trying to build a very basic serial shell with my arduino.
I am able to get an output from the device using Serial.read() and can get the character it has outputted, but I cannot work out how to then add that character to a longer to form the full command.
I tried the logical thing but it doesn't work:
char Command[];
...
I have one form opening a second form which is meant to look like it's replaced the first form but it opens a bit to the right and down which ruins the effect.
If there a way to make it open wherever the first form may be?
I am using visual studio, in C++
...
What's the difference between the following two declarations? I thought they were equivalent, but the first sample works, and the second does not. I mean it compiles and runs, but the bitmap display code shows blank. I have not stepped through it yet, but am I missing something obvious? GUI_BITMAP is a simple structure describing a bitma...
I'm working on a english only C++ program for Windows where we were told "always use std::wstring", but it seems like nobody on the team really has much of an understanding beyond that.
I already read the question titled "std::wstring VS std::string. It was very helpful, but I still don't quite understand how to apply all of that infor...
Hi, I am quite new to COM so the question may seem naive.
Q1. About Windows DLL
Based on my understanding, a Windows DLL can export functions, types(classes) and global variables. Is this understanding all right?
Q2. About COM
My naive understanding is that: a COM DLL seems to be just a new logical way to organize the functions and t...
Hi all,
I have a string, for example; "llama,goat,cow" and I just need to put a '@' in front of each word so my string will look like "@llama,@goat,@cow", but I need the values to be dynamic also, and always with a '@' at the beginning.
Not knowing a great deal of C++ could someone please help me find the easiest solution to this proble...
Hi, I'm trying to use the SDL_Image library and I've added the .so to the link libraries list for my project (I'm using Code::Blocks, by the way).
After doing this, when I go to compile, I get this error:
Linking console executable: bin/Debug/ttfx
/usr/lib32/libSDL_image-1.2.so: could not read symbols: File in wrong format
What does ...
After years in embedded programming, I have to develop a Windows app. I dug out my old C++ Builder and Delphi. These are great and the latest version costs over $1k, so I won't be going there.
What I particularly like is the VCL (visual component library) which let's me code my own components and share them with others, plus the thousan...
I have a member function in a class that has a callback, but the callback isn't strictly neccessary, so it has a default callback, which is empty. It seems to work fine, but I get an annoying warning:
warning: converting from ‘void (ClassName::*)()’ to ‘void (*)()’
I'm trying to figure out what it means and how to turn it off (or fix ...
I have declared a class as
class DCFrameListener : public FrameListener, public OIS::MouseListener, public OIS::KeyListener
{
bool keyPressed(const OIS::KeyEvent & kEvt);
bool keyReleased(const OIS::KeyEvent &kEvt);
//*******some code missing************************
};
But if i try defining the members like this
boo...
Hello
I have a such syntax in program
/* The Object1 is allowed to be changed */
class Object1 : BaseClass {
BaseClass *link;
int i;
public:
Object1(int a){i=a;}
Object1(int a, Object1 /*place1*/ o) {i=a; link= &o;}
};
int main(){
/* The initialization syntax must be preserved. No any new(), no other local objects...
so the following converts big endians to little ones
uint32_t ntoh32(uint32_t v)
{
return (v << 24)
| ((v & 0x0000ff00) << 8)
| ((v & 0x00ff0000) >> 8)
| (v >> 24);
}
works. like a charm.
I read 4 bytes from a big endian file into char v[4] and pass it into the above function as
ntoh32 (* reinterpret_cas...