hey, i got something that i cannot understand ,there are two types of solutions for overloading this operator 1 is including the friend at the start of the method and the other 1 goes without the friend.
i would very much like if some1 explain whats the difference between them advantages / disadvantages.
for example overloading the opera...
Hi,
I am currently trying to work on getting my virtual trackball to work from any angle. When I am looking at it from the z axis, it seems to work fine. I hold my mouse down, and move the mouse up... the rotation will move accordingly.
Now, if I change my viewing angle / position of my camera and try to move my mouse. The rotation will...
I'm working on what is essentially the runtime for a large administrative application. The actual logic that is being executed, as well as the screens being shown and the data operated upon is stored in a central database. In order to improve performance, the runtime keeps data queried from the database in various caches.
However, it is...
Summary
I want to run my cross-compiled application against the 10.5 libraries. Is there an environmental variable that allows this to work?
Longer version
I cross-compiled my OS X C++ application for a 10.5 target, on a 10.6 host. It compiles fine. The compiled application is linked against libraries like /usr/lib/libstdc++.6.dylib. ...
I would like to know if including atlbase.h in my c++ project will make the compiled application to have a dll dependency or something like that.
...
Hello, I'm using boost's singletons (boost::serialization::singleton).
I have to control the queue of class destructings. One singleton consist of the object whicn uses object from second singleton. And I have to delete second singleton, before the first one. Can I do this?
p.s. please, don't say anything about singleton programming tec...
Hi!
I have been using advance on some iterators, but I am afraid of a possible leapfrog above end(). I would like to make sure my iterators stay between the bounds, I thought of the distance but it seems it does not return what I would be expecting (non-positive values when iterators overpass end()). How would you make sure there is no ...
for ex: let a 2-D array be
1 2 3
2 3 5
7 8 9
Then the output must be
1 2 3
3 5
9
Using simple for loops
i want the syntax.
...
Lets say I've this exception class:
struct MyException : public std::exception
{
MyException(const std::exception &exc) : std::exception(exc)
{
cout << "lval\n";
}
MyException(std::exception &&exc) : std::exception(std::forward<std::exception>(exc))
{
cout << "rval\n";
}
};
...
...
try
{
thr...
This is pretty easy in PHP:
$con = mysql_connect("localhost:".$LOCAL_DB_PORT, $LOCAL_DB_USER, $LOCAL_DB_PASS);
mysql_select_db("db", $con);
mysql_query("set names utf8", $con);
$result = mysql_query("select ...");
while($row = mysql_fetch_assoc($result))
{
...
}
But what's the easiest way to do it with c/c++ in windows?
...
Say I have the line in this format
"word word 12 YR" or "word word 10 MO"
and I want to convert it to
char * containing either "12Y" or "10M" respectively.
The format is two words followed by numerical followed by the word denoting the year or the month. words are space/tab separated. Currently, I am playing around with the s...
if i have a template function:
template<class T, class S>
void foo(T t, S s){..//do something//}
and then, inside the main i do this:
string str = "something";
char* ch = "somthingelse";
double num = 1.5;
foo(ch, num);
foo(num, ch);
foo(str, num);
..
my question is in the compilation what code will be written at the executable?
is ...
I have a question concerning the use of boost::lock_guard (or similar scoped locks) and using variables that should be protected by the lock in a return statement.
How is the order of destroying local objects and copying the return value? How does return value optimization affect this?
Example:
Data Class::GetData()
{
boost::lock_...
I'm using a C++ std::map to hold a large collection of entities:
using std::map;
map {structureEntityID, classEntityRecord} tableEntityRecords; //(replace {}s with arrows)
I will be frequently modifying the entities in my table (many times a second). Is it better to modify those records via a pointer or is it better to make a local ...
Can some one recommend approaches to parallelize in C++, when the data to be acted up on is huge. I have been reading about openMP and Intel's TBB for parallelization in C++, but have not experimented with them yet. Which of these is better for parallel data processing ? Any other libraries/ approaches ?
...
Hi,
i want to replace a
#define INTERVAL_MASK(b) (1 << (b))
with a inline function.
int INTERVAL_MASK(int b)
{
return (1 << b);
}
But i have a switch case, which uses the preprocessor directive in case statements. How to go about converting this? Replacing the switch with if is the only option?
Thanks,
gokul.
...
hi,
i have 2 questions.
does any one know what an hpp file is? why would someone do that ?
i am trying to implement a class that extends vecotr
but i want to use all thee riginal functinos and add on actions for each functin.
so i wrote:
#include <iostream>
#include <vector>
#ifndef _MY_PERSONAL_VECTOR
#define _MY_PERSONAL_VECTOR
...
I have issues with debugging of a library loaded at runtime, and an unknown is:
Does winbase::LoadLibrary() load the .pdb in debugging mode?
Because if it doesn't, that would explain why I cannot use any debugging in my DLL, and if it does, that would at least tell me to search for the problem somewhere else.
Obvious follow-up: If it...
why integer has a range between 0 and 32768?
...
I've started using CMake as a build tool for a cross-platform command line program that requires FFTW3 and Boost.Format. I'm familiar with the Unix-like standard directory structures for headers and binaries of installed libraries but I'm wondering what the quasi standard is on Windows platforms as to how and where libraries are installe...