What's the convention for naming functions in C++?
I come from the java environment so I usually name something like:
myFunction(...){
}
I've seen mixed code in C++,
myFunction(....)
MyFunction(....)
Myfunction(....)
what's the correct way?
Also, is it the same for a class function and for a function that's not a class function?...
Does anybody know how can I customize title bar of a main window in QT? I would like to make some custom painting over the "normal" drawing.
The QT version I'm interested in is 4.5 or 4.6 (beta)
...
Is any posibility to add widgets in titlebar of QMainWindow?
I try to avoid "emulate" a title bar by making a custom widget for that and hiding the default title bar (from Qt::WindowFlags).
I am using QT 4.5 or 4.6 beta.
...
There are at least two methods for copying a file in C/C++: procedurally and using ShellExecute. I can post an explanation of each if needed but I'm going to assume that these methods are known. Is there an advantage to using one method over the other?
...
I am currently working on a project that will act like a Online selling website such as Amazon, or Ebay in a very small scale. I was wondering if anyone could point me in the right direction on how to use Timers for C++. Learning Socket Programming at the moment, and was trying to incorporate the timer for the auction time when someone i...
Hi all,
I am working on a project written in C++ which involves modification of existing code. The code uses object oriented principles(design patterns) heavily and also complicated stuff like smart pointers.
While trying to understand the code using gdb,I had to be very careful about the various polymorphic functions being called by the...
Hi all I'm having trouble with C++ template operator=
What I'm trying to do:
I'm working on a graph algorithm project using cuda and we have several different formats for benchmarking graphs. Also, I'm not entirely sure what type we'll end up using for the individual elements of a graph.
My goal is to have a templated graph class and a...
OK, so I have two (completely unrelated, different project) classes using iterators now. One has iterator and reverse_iterator working as intended, and the other, current one has iterator and a semi-broken const_iterator (specifically, because const_iterator derives from iterator, the code LinkedList<int>::iterator i = const_list.begin()...
I'm trying to keep some array data synchronized with the contents of a QTableWidget. I'd like to enable drag and drop reordering (moving items within the table, as opposed to copying), but it's not clear to me how, when the drop event is fired, I can find out what index the item was dragged FROM. Hence, I have no way of knowing what ob...
I am tasked with creating a small program that can read in the definition of a FSM from input, read some strings from input and determine if those strings are accepted by the FSM based on the definition. I need to write this in either C, C++ or Java. I've scoured the net for ideas on how to get started, but the best I could find was a ...
Say, I want to create a File class
class File{
public:
File(const char *file){
openFile(file);
}
~File();
isEmpty();
};
openFile checks if the file exists or if the contents of the file are valid or not.
File *file = new File("filepath");
if(file)
file->isEmpty();
if my fil...
hello
how can I create STL collection of classes which implement abstract base class using the base class as collection value, without using pointers?
is there something in Boost that allows me to implement it? The collection specifically is map.
Thanks
...
hi, guys
now i need to design/organize the source-code structure and makefiles for the next project. This is a software implemented largely by C++ and supposed to be used normally on Linux. It will include following components:
projecthome/3rd_party_lib_boost/ hdr and src
projecthome/3rd_party_lib_from_vendor/ hdr and src
# libraries ...
Hi,
I'm looking to add full text indexing to a Linux desktop application written in C++. I am thinking that the easiest way to do this would be to call an existing library or utility. This article reviews various open source utilities available for the Gnome and KDE desktops; metatracker, recoll and stigi are all written in C++ so they...
I'm trying to build an email application in Visual Studio 2005 and I'm using .NET's System::Net::Mail::Smtp class to send emails, but I can't figure out how to authenticate SMTP with a server (right now I've been trying with smtp.gmail.com the most).
Here's my code:
SmtpClient^ client = gcnew SmtpClient("smtp.gmail.com");
NetworkCreden...
Question:
Given the following code snippet:
bool foo(int n) {
for(int i=3;i<sqrt(n)+0.5;i+=2)
{
if((n%i)==0){
return false;
}
}
return true;
}
Can you figure out what is the purpose of the function foo ?
Well,On first look it may seems that foo is checking for prime numbers but it is not...
I am having trouble trying to figure out how i would display a month without having to display "January" like in my switch - if i try to just oputput it i get a number 1
Do i need to create memory for the date priceDate; private member?
than copy in my copy constructor?
sorry about formatting. i had to move stuff over so it would displ...
Hey Everyone!
Quick question. Does anyone know how to get the function pointer of an objective c method?
I can declare a C++ method as a function pointer, but this is a callback method so that C++ method would need to be part of the class SO THAT IT CAN ACCESS THE INSTANCE FIELDS. I don't know how to make a C++ method part of an objectiv...
Hello everyone, I would really appreciate your help in this.
I have been trying to get a Dll injected into a remote process and do a few changes inside it, the problem I'm encountering right now is i don't know how to get this going.
So first, here is my piece of code that I have developed so far:
dllmain.cpp
#include <windows.h>
#inc...
How do you setup a G++ compiler for MonoDevelop?
On both OS X and Windows Vista the default install complains about "Compiler Not Found: g++".
Is MonoDevelop not a good cross platform IDE for C++ development (since it is a C#/Java IDE).
Thanks SO!
...