I am not sure whether I should post this question here, because this seems to be a programming-oriented website.
Anyway, I think there must be some gurus here who knows this.
Now I have a AMD Opteron server running CentOS 5. I want to have a compiler for a fairly large c++ Boost based program. Which compiler I should choose?
...
I have been looking for a while, but I just can't seem to find any implementation of the 2-Sat algorithm.
I am working in c++ with the boost library (which has a strongly connected component module) and need some guidance to either create an efficient 2-Sat program or find an existing library for me to utilise through c++.
...
Is it possible to define the padding of QTableView cells? I would expect this to be possible using CSS stylesheets, but the documentation does not describe a method to do this.
The following stylesheet does not have the desired effect:
QTableView {
padding: 5px;
}
as it influences the padding property of the widget as a whole, not ...
I have Ubuntu 9.04 and KDevelop IDE.
When I am trying to debug C++ console app, it tells me:
GDB cannot use the tty* or pty* devices.
Check the settings on /dev/tty* and /dev/pty*
As root you may need to "chmod ug+rw" tty* and pty* devices and/or add the user to the tty group using "usermod -G tty username".
I installed gcc and gdb, and ...
I created an application for Windows in C++ using QT. If I want to port it to Linux or Mac OS, will sizeof(int) or sizeof(long) change? In other words, do types in QT applications for different platforms have similar size?
...
I want to set the embedded icon for my executable console program to a custom icon.
I know this is pretty much the same question as this one here, but I'm using Visual C++ 2008 Express Edition, and the Resources View is not available (and the Project-context-menu->Add->Resource... is grayed out), so I'm at loss here. Will I have to upgr...
I wonder if the naming convention used in C/C++ standard libraries has a name, or at least a cheat-sheet where I can lookup the rules. E.g.
push_back -- underscore used
setstate -- but not used here!
string::npos -- when to use abbreviations?
fprintf
...
Does the naming convention used in the C/C++ standard libraries have a sp...
What does 0x0A mean in C++ and how should I interpret or read such hexadecimal values?
if (version < 760 || version > 760){
disconnectClient(0x0A, STRING_CLIENT_VERSION);
}
uint32_t accnumber = msg.GetU32();
std::string password = msg.GetString();
if(!accnumber){
disconnectClient(0x0A, "You must enter your account number.");
...
which come first class or object in object oriented languages ?
...
Hi, I got a really simple question.
string str;
cin >> str;
cout << str;
if I type in "Hello World" the output I get is only "Hello". I know it probably has to do with whitespace. So my question is how I should write if I want the whitespace as well?
I have also tried to use getline(cin, str); but it will only read input first time a...
Any time I embark on a project that requires some rendering of primitive shapes and lines, I usually turn to Java because it's just so easy. For my latest project, I decided I might like to learn another API similar to but not Java Graphics2D. I would preferably like something that will work with C++ on Linux. Does anybody have any go...
Hi!
I'm new to generic class programming so maybe my question is silly - sorry for that. I'd like to know whether the following thing is possible and - if so, how to do it
I have a simple generic class Provider, which provides values of the generic type:
template <class A_Type> class Provider{
public:
A_Type getValue();
void setSu...
Since a copy constructor
MyClass(const MyClass&);
and an = operator overload
MyClass& operator = (const MyClass&);
have pretty much the same code, the same parameter, and only differ on the return, is it possible to have a common function for them both to use?
...
hi there
I'm into the learning stage of C and PHP. Until now I was using MS Visual Studio IDE for C/C++ applications and Notepad++ for PHP application.
Now I'm thinking to use same IDE for those languages and Eclipse seems to support both of them.
My questions are:
- Do you think is good to forgot about using MS Visual Studio for Ecl...
Suppose I have some code like this:
class Base {
public:
virtual int Foo(int) = 0;
};
class Derived : public Base {
public:
int Foo(int);
virtual double Foo(double) = 0;
};
class Concrete : public Derived {
public:
double Foo(double);
};
If I have a object of type Concrete, why can I not...
When I construct a boost::options_description instance like
options.add_options()
("double_val", value(&config.my_double)->default_value(0.2), "it's a double");
and later want to have the automated output of the options that are available for my program, and put
std::cout << options << std::endl;
the default value 0.2 is shown wi...
This program supposed to find command line arguments entered on Unix which ends with “.exe”. For some reason it doesn't work. Here is the code:
int main( int argc, char* argv[] )
{
for ( int i = 1; i < argc; i++)
if( findExe( argv[i] ) )
cout << argv[i] << endl;
return 0;
}
bool findExe( char* argument )
{
if ( s...
I was trying to answer this question. As suggested by the accepted answer, the problem with that code is that not all control paths are returning a value. I tried this code on the VC9 compiler and it gave me a warning about the same. My question is why is just a warning and not an error? Also, in case the path which doesn't return a valu...
I would like to create a portable library for iPhone, that also could be used for other platforms.
My question is the fallowing:
Does anyone knows what is the best to be used on the iPhone: Objective-C or Objective-C++? Does it works with C++ the same way as Objective-C with C or not?
Reasons: Objective-C is a superset of C, but Objec...
Hi! I've got the following lines of code:
p_diffuse = ShaderProperty<Vector4>(Vector4(1,1,1,1));
addProperty(&p_diffuse, "diffuse");
p_shininess = ShaderProperty<float>(10.0f);
addProperty(&p_shininess, "shininess");
the addProperty function is implemented as follows:
template <class A_Type>
void IShader<A_Type>::addProperty( Shade...