Basically I would like to know the difference between
Int32^ i = gcnew Int32();
and
Int32* i2 = new Int32();
I have written the following code:
#include <stdio.h>
#using <mscorlib.dll>
using namespace System;
int main(void) {
Int32^ i = gcnew Int32();
Int32* i2 = new Int32();
printf("%p %d\n", i2, *i2);
pr...
Is anyone using JIT tricks to improve the runtime performance of statically compiled languages such as C++? It seems like hotspot analysis and branch prediction based on observations made during runtime could improve the performance of any code, but maybe there's some fundamental strategic reason why making such observations and impleme...
Hello to every body
I hope every one keep in best state.
I want to help me in solve this problem in my Sheet .
I use recurrence functions in like list.( with ADT file ) by modify the search function and adding Printing function in a Reverse Manner.
template <class TYPE, class KTYPE>
bool List<TYPE, KTYPE> :: _search (NODE<TYPE> **pP...
Background
I am just getting started with C++ programming on LINUX. In my last question, I asked about best practices of using makefiles for a big application. "SO" users suggested to read Miller's paper on recursive makefiles and avoid makefile recursion (I was using recursive makefiles).
I have followed miller and created a makefile...
How do you debug lua code embedded in a c++ application?
From what I gather, either I need to buy a special IDE and link in their special lua runtime (ugh). Or I need to build a debug console in to the game engine, using the lua debug API calls.
I am leaning toward writing my own debug console, but it seems like a lot of work. Time th...
> typedef pair<double, double> dd;
const double epsilon = 1e-6;
struct sort_by_polar_angle {
dd center;
// Constuctor of any type
// Just find and store the center
template<typename T> sort_by_polar_angle(T b, T e) {
int count = 0;
center = dd(0,0);
while(b != e) {
...
I've got a static class member which is some container, like
(Foo.h)
class Foo
{
...
private:
static list<string> s_List;
}
I need to populate the list with a number of specific values. Actually it should be also const, but that might overcomplicate the problem further.
All the class member functions are static, so initializing...
So far for C++ Linux development, I've used Eclipse CDT and Code::Blocks. Compared to Visual Studio on Windows, their code completion features aren't too great. Could someone please suggest an IDE that has better C++ code completion than what I have tried so far?
A thread on the Ubuntu Forums suggests that Code::Blocks is actually super...
Hello!
What are the advantages of using boost.any library ? Could you please give me some real life examples ? Why the same functionality couldn't be achieved by having some generic type in the root of object's hierarchy and creating containers with that base type ?
...
Hi,
I have a 3rd party DLL that needs to be loaded dynamically using LoadLibrary() and which uses the __cdecl calling convention. I need to be able to use the dll from VB6 so I've created a wrapper DLL of my own that uses the __stdcall calling convention and exports the functions that are needed.
An additional requirement has now arri...
I am working on a 'print preview' facility to show an overview of a slide with rectangular arrays of sample spots on it.
The slides typically measure 25 x 75 mm and the spot samples are typically 0.1 mm in diameter. There is usually a 2mm gap around the perimeter of the slide where no spots are printed.
The distance between spots (pit...
Have a SomeLib.pro file that contains:
CONFIG += debug
TEMPLATE = lib
TARGET = SomeLib
..
Then in a dependent SomeApp.pro:
..
debug:LIBS += -lSomeLib_debug
..
How can I force SomeApp to build if I touched SomeLib in qmake?
...
I've been trying to compile a Borland C++ Builder 6 project, but linker dies with exact following error:
[Linker Fatal Error] Fatal: Unable to open file '.OBJ'
Strange thing about it is that it doesn't give any file name except the extension. It looks like an internal bug, though googling for it didn't give any results. Has anyone enc...
I have recently discovered that when I have pointers within a class, I need to specify a Copy constructor.
To learn that, I have made the following simple code. It compiles, but gives me runtime error when performing the copy constructor.
I am trying to copy just the value from the pointer of the copied object, but avoiding assigning t...
Is there any way to debug a single file in Visual Studio.NET?
I'm still a noob with C++, but I want to start learning how to get comfortable with the debugger, and as of right now I am writing really small files.
It seems if there is only one source file, it won't let me debug, but the moment I add another one, I can. I am using VS.net...
I use the following code to compile a cpp file to object file.
g++ -c main.cpp
Above code generates the .o fles in same directory where main.cpp resides.
Suppose I have a folder named obj and need to generate the object files there, how do I write?
How can I see the compiler switches supported by g++ and it's usages?
Any help wou...
A question prompted by jbar's question.
In scripting languages like Python, Ruby, and Perl, there are libraries that simplify generating dynamic HTML. (For example, the cgi module in Ruby.)
Are there any similar packages for C++? I don't know of one, and at least some desultory googling didn't reveal one.
...
From My last question: Marching Cube Question
AndreasT has explained to me how the triTable and edgeTable works.
I really can't thank him enough.
However, i am still unclear as in:
how to create imaginary cube/voxel to check if a vertex is below the isosurface?
how do i know which vertex is below the isosurface?
how does each cube/vo...
I'm beginner in c++ and I hopeless to parse dynamic function form string like
char* func = "app.exe /path:\"@FileExists('filepath', @FileDelete('filepath'), @MsgBox('file not found','error',1))\";
I want to parse
@FileExists('filepath', @FileDelete('filepath'), @MsgBox('file not found','error',1))
can you help me?
sorry for my en...
I have an array of raw rgb data.
I would like to know how can I draw this pixels on the screen in Windows OS?
Now I use API function DrawDIBits, but I must turn up my image data.
...