*I say rotating an object on its own axis but I think my term is wrong...what I mean by that is like rotating my object from the objects center and not at the origin
I'm trying to make a program that rotates my object(made by using a matrix of points/vertices) in its *own axis without the use of glRotate or glTranslate
What I did was to...
Possible Duplicate:
Prevent scientific notation in ostream when using << with double
I get 1e-1 as result after a computation how can I convert the result from exponent to dot notation i.e., 0.1 ? Why is it automatically converted to exponential notation!!
...
Hi All,
I would like to define some template member methods inside a template class like so:
template <typename T>
class CallSometing {
public:
void call (T tObj); // 1st
template <typename A>
void call (T tObj, A aObj); // 2nd
template <typename A>
template <typename B>
void call (T tObj, A aObj, B bObj); // 3r...
Hi, I'm wondering if it's possible to combine multiple DLL's into 1. I'm currently working on a C++ project that is dependent on many dynamic link libraries,so would it be possible to combine them into 1 DLL file, and if so, how would I do that?
...
Hello, everyone...
I've completed a simple numbers-version of the game "Towers of Hanoi" using xcode's command line tool in C++. Being accustomed to PC compilers like borland's and visual-c, I've attempted to "share" the game with others via e-mail by simply attaching the executable product built by xcode. However, the recipients can't ...
Hi,
I just discovered this old C++0x draft about modules in C++0x.
The idea was to get out of the current .h/.cpp system by writing only .cpp files which would then generate module files during compilation, which would then in turn be used by the other .cpp files.
This looks like a really great feature.
But my question is: why did the...
I am trying to do console application to read pixels from image:
#include <QtCore/QCoreApplication>
#include <QtGui/QImage>
#include <iostream>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QImage *img = new QImage("adadad.jpg");
//std::cout << "Type filename:" << std::endl;
img->isNull();
ret...
Possible Duplicate:
Which IDE is best for C++ ?
I am just starting in the Computer Science scene and would like to know about a specific app I could use to just start writing codes.
...
How do you integrate C or C++ open-source third party libraries in your projects? Do you copy all the files it comes with (i.e. README, makefiles etc) to a separate directory somewhere inside the project and build it using its configs? Or do you only get needed source files and headers from a source package? Or do you just install pre-bu...
I'm trying to do something along these lines:
int var = 5;
std::numeric_limits<typeid(var)>::max();
but surprise, surprise it doesn't work. How can I fix this?
Thanks.
...
I'm writing a compiler with LLVM. Each source file is compiled into an LLVM bitcode file. Eventually the linker links and optimizes all the bitcode files into one final binary.
I need a way to read the bitcode files in the compiler in order to access the type information. The LLVM documentation shows a class called BitcodeReader, but th...
Hey so I am working on an overload of +, but when I try to do a simple call like
statistician a,b,c;
a = b+c;
When I do the above call it crashes. and if i do an overload of =, it just returns a zero.
here is some of my code. Thanks for the help guys!!!
FYI next_number(double value), increases the dynamic array by 1, and puts that ...
Hello, I'm writing statistic system. It should make some output with given params. For example:
float getSunActivity() { ... }
int getEarthActivity() { ... }
StatisticSystem::track("sun_activity", boost::any(getSunActivity()));
StatisticSystem::track("earth_activity", boost::any(getEarthActivity()));
class StatisticSystem
{
typedef...
While writing some test cases, and some of the tests check for the result of a NaN.
I tried using std::isnan but the assert failes:
Assertion `std::isnan(x)' failed.
After printing the value of x, it turned out it's negative NaN (-nan) which is totally acceptable in my case.
After trying to use the fact that NaN != NaN and using ass...
I tried the MSDN code edited that, but still the problem is that when I send 271 bytes data, my WSARecv() shows me 542 byte data, which is just duplicate copy.
How can I overcome this problem?
http://msdn.microsoft.com/en-us/library/ms741688(v=VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms742203(v=VS.85).aspx
...
Hi everyone!
I'm considering of data structure for storing a large array of strings in a memory. Strings will be inserted at the beginning of the programm and will not be added or deleted while programm is running. The crucial point is that search procedure should be as fast as it can be. Saving of memory is not important. I incline to s...
I need several C++ classes to have a static method "register", however the implementation of register varies between those classes.
It should be static because my idea is to "register" all those classes with Lua (only once of course).
Obviously I can't declare an interface with a static pure virtual function. What do you guys sugges...
I'm writing an caching app that consumes large amounts of memory.
Hopefully, I'll manage my memory well enough, but I'm just thinking about what
to do if I do run out of memory.
If a call to allocate even a simple object fails, is it likely that even a syslog call
will also fail?
EDIT: Ok perhaps I should clarify the question. If ma...
Is shared memory stable at the first place?
I prefer this way to inter-process/application communication because that way I don't need the overhead of parsing data.
Is there a good hello world demo on this in c/c++?
...
I was trying to program a Timer class (unaware that boost had one), then when that wasn't working, I tried to just output the value of clock(), using this code:
#include <ctime>
#include <iostream>
int main()
{
for(int i = 0; i < 50; ++i)
{
std::cout << std::clock() << " ";
}
return 0;
}
When I run the program, I get a series o...