The following is based on the code that I posted on this thread. Aside from the obvious bugs, I get the following compilation errors? Any idea why?
The odd thing is that this only occurs for the template class. If I add another non template class to the same .h and .cpp file of the template class and try to instantiate just the non temp...
How to use magnet links in LibTorrent C/C++ lib?
I need an simple example of working with it - Something like I give him a link he gives me a file.
...
I want to reorganize my C++ code project, which contains of hundreds of source files.
I want to split everything into 4 libraries, taking care to avoid cyclic dependencies:
(a) src/core
(b) src/util
(c) src/create
(d) src/process
Basically, core implements the basic data structures and util implements some basic utility functions to ...
Hello,
I'm currently learning C++ and I've learned about the incrementation a while ago.
I know that you can use "++x" to make the incrementation before and "x++" to do it after.
Still, I really don't know when to use which... I've never really used "++x" and things always worked fine so far, but when should I use it?
Exemple : In a fo...
How can I use a C++ class in C#? I know you can use DllImport and have the class as IntPtr, but then how would I call the functions inside the class? And I don't want to create a new method for each method in the class and export that, then there is not point for me to use a class then...
Without creating a COM app
C++ Class:
class My...
How do I generate random chars and integers within a method so that the method can be called in main() and so that the method generates random chars and integers together. I do not want a method that genrates chars and another methods that generates integers.
...
What is the method to tell the console to wait for x seconds. Is there a built in method or must I make one.
...
What's the simplest way to read a registry key value to std::String?
Say I've got :
HKEY_LOCAL_MACHINE / SOFTWARE / MyApp / value1 = "some text"
HKEY_LOCAL_MACHINE / SOFTWARE / MyApp / value2 = "some more text"
How do I get those values to std::string in a fast way ?
...
std::map.find() is intended to return an map::iterator to an element it found if there is some or to the end() if not. I get BadPtr returned to me. The exactly same construct works fine in the other part of code. What is this?
class OntologyContainer {
map<string, OntologyClass*> data;
OntologyClass* last_added;
public:
clas...
I have a base class, say BassClass, with some fields, which I made them protected, and some pure virtual functions. Then the derived class, say DerivedClass, like class DerivedClass : public BassClass. Shouldn't DerivedClass inherit the protected fields from BassClass? When I tried to compile the DerivedClass, the compiler complains that...
I just added a CMFCRibbonEdit to my ribbon but it seems it does not get the focus.
It appears disabled.
I even copy/pasted an implementation of the creation of this control from a Microsoft sample but I get the same behaviour.
Any idea on what I may be doing wrong or forgetting to do ?
...
Edit:
indent -bap foo.cpp
works
Is there any easy way to insert a new line or insert a text before the beginning of every function definition in C++ file?
int main() {
return 0;
}
void foo() {
}
becomes
int main() {
return 0;
}
void foo() {
}
...
EDIT: I forgot to add the loop part of the second code.
Looking at the two code styles
while(some_loop_cont_val)
{
while(pre_x is not done)
{
//do action pre_x
}
//do action x
}
and
while(some_loop_cont_val)
{
if(pre_x is not done)
{
//do action pre_x
}
else
{
//do action x...
I am trying to use "indent" program to indent C++ programs. But it does not seem to work fine. It is messing up the indentation much more.
It is a Class file. Can you please suggest the right options for it or another program that works?
Thanks
...
Hey guys,
So I'm quite new to C++, I've basically been coding it all semester for a class. For our final project, we made an email client in C++ with .NET, and to do all the email sending and receiving, we went with using the POCO email client.
Now, basically in order to use the POCO library, I've compiled it and done a number of thing...
I have tried lookin for the answer to this question, but was not able to do this.
Whats the most basic way to do it?
...
So I have in my main function:
string s = "\nWelcome to Rawr\n";
const QString output(s);
**emit output(output); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Getting an error here**
I have set up a Signal in QT Desginer named: output(const QString &s)
My receiver for the signal is my "Form"... in my form.h i have:
The slot is called "change...
I'm building a class wrapper for the mysql c api, specifically at the moment for mysql_real_escape_string and I don't think I'm doing it quite right.
this is what I have for the function:
std::string Database::EscapeString(const char *pStr)
{
char *tStr = new char[strlen(pStr)*2+1];
mysql_real_escape_string(m_sqlCon, tStr, pStr...
Greetings!
I am currently attempting to extend the functionality of the Magic Mouse. To do this, I am hoping to write a kext that intercepts events from the multitouch driver, AppleMultitouchDriver.kext, interprets them, and either dispatches new events or forwards the actual event. This approach is similar to the approach used by Doubl...
I've always been curious about audio conversion software, but I have never seen a proper explanation from a beginners point of view as to how to write a simple program that converts for example, a mp3 file to a wav. I'm not asking about any of the complex algorithms involved, just a small example using a simple library. Searching on SO, ...