I've attempted to follow the instructions from various places [1][2][3], but I keep getting link errors when attempting to use GLUT and OpenGL in Cygwin. Everything I try gives me a link error similar to:
$g++ -Wall -pedantic -c -o triangle.o triangle.cpp
$g++ -o triangle *.o -lglut32 -lglu32 -lopengl32 -o triangle
triangle.o:triangle....
I have used Lua.NET on .NET platform and I could call the .NET class/object from Lua and I could call the Lua from .NET Lua API interface. I did the same with the IronPython. I knew the how the .NET binding works.
Now I have a C++ project and I want to use the dynamic capabilities. I want to call C++ object which may not be possible fr...
I've faced with problem i need to get content from site but before i need authorize. Now i looking for library(or some kind of this stuff) to parse all post data (i try use regex but i searching for alternative)
...
The output of the following code is "321" without quotes. Why not "123"?
#include <iostream>
using namespace std;
int& inc(int& start)
{
return ++start;
}
int main()
{
int i = 0;
cout << inc(i) << inc(i) << inc(i) << endl;
}
...
How do you include header files from top-level and sub-directories in c++?
...
Is there any way to adjust tab width in the console?
...
I am a complete novice in C++. I am trying to read a file and build a lookup table (more like a hashtable just to check the existence of a string value). The file has about 300 thousand entries that I will use to build a lookup table. And after this, I will be performing some 1 million lookups on this. What is the most efficient way of d...
I'm having the following code:
CMainFrame* pFrame = new CMainFrame;
if (!pFrame)
return FALSE;
m_pMainWnd = pFrame;
// create and load the frame with its resources
pFrame->LoadFrame(IDR_APP_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
// The one and only window has been initialized, so show and update it
pFr...
Can anyone give me an example of a Java program which has two native methods declared and defined in C and C++. Actually, I need a procedure as well as the code, so that I can run it and learn from it, thanks.
...
Recently we found a "good way" to comment out lines of code by using continue:
for(int i=0; i<MAX_NUM; i++){
....
.... //--> about 30 lines of code
continue;
....//--> there is about 30 lines of code after continue
....
}
I scratch my head by asking why the previous developer put the continue keyword inside the intensive loo...
I am writing a multi threaded server app that requires stability and high performance. I'm looking at using Boost for some data structures I need.
Is an intrusive data structure better or worse for something that should be thread safe and needs fast access, insertion, etc:::: ?
...
Why is a bit, called a bit. Why is a 8-bits a Byte? What made people call a 16-bits a Word, and so on. Where and why did their alias come about?
I would love other people to include things like basic ASM types, then branch out to C/C++ and move on to SQL and the like's datatypes.
1-Bit
Bit - binary Unit
Bool - Named after the invento...
Hi everyone, i'm writing program for Nokia 5230 (S60 5th edition platform) using Nokia Qt SDK. I have the problem with retrieving geolocation info. I'm trying to use example from nokia forum (http://bit.ly/be3QDK first one). The following code:
#include <lbs.h>
#include <lbsrequestor.h>
#include <lbscommon.h>
#include <lbsposition.h>
#i...
I'm preparing for an exam in Java and one of the questions which was on a previous exam was:"What is the main difference in object creation between Java and C++?"
I think I know the basics of object creation like for example how constructors are called and what initialization blocks do in Java and what happens when constructor of one cl...
------------ ------------
| TclObjct | | Handler |
------------ ------------
|__________________________________|
|
--------------
...
I am trying to compile the SkpWriter example from the latest SketchUp C++ SDK. However, the linker gives me LNK1104 saying that "mfc80u.lib" could not be found since one of the static libraries (Utils.lib) in the SDK depends on some MFC 8 libraries. I am using VS2008 and only mfc90u.lib is available.
Is there a way to use mfc90u.lib in ...
I was just going through some codes of C++.
Where in I came across the concept of reinterpret_cast operator.
EDIT 1 :
I know that accessing private members of a class is not recommended.
But in some situations we ought to go ahead and access them.
I have just put forth this question to get my concepts clear.
In the example that I re...
One of my "non-programmer" friends recently decided to make a C++ program to solve a complicated mechanical problem.
He wrote each function in a separate .cpp file, then included them all in the main source file, something like this:
main.cpp:
#include "function1.cpp"
#include "function2.cpp"
...
int main()
{
...
}
He then compile...
There are some Linux based C++ projects in the pipe. What IDEs should I go for that have some kind of "intellisense" in par with, or better, than the one of a bare Visual Studio (that is, without the Visual Assist steroids).
(Note that I didn't use the words "as good as, or better". I consider the Visual Studio C++ intellisense everythi...
Yesterday I discovered an odd bug in rather simple code that basically gets text from an ifstream and tokenizes it. The code that actually fails does a number of get()/peek() calls looking for the token "/*". If the token is found in the stream, unget() is called so the next method sees the stream starting with the token.
Sometimes, see...