When ever I use the STD namespace, my programs become dramatically slower. In other words, C++ things such as string, new, delete, and cout all cause code to run super slow. I get around this by...
Type: Posts; User: thetinman
When ever I use the STD namespace, my programs become dramatically slower. In other words, C++ things such as string, new, delete, and cout all cause code to run super slow. I get around this by...
What I mean is a language with equivalent functionality, but different syntax. Basically, something that transpiles into C/C++. Are there any that are ready for production code?
I've been using...
I had not thought of a good way to test that. It looks like explicitly calling a constructor always instantiates an object, while inheriting a class does not.
class Foo : public Bar {
public:
Foo();
Foo(char b);
private:
char x;
};
Foo::Foo (char b) {
As far as I know, I am using the proper calling conventions for JNI and Python. Although, I would say that there is limited authoritative reference on Python (and I haven't read too much about JNI). ...
When compiled as a stand-alone program, my code always behaves as I expect it to.
However, I've also compiled my code as a shared library. For some reason, calling the library from both Java...
I'm trying to optimize an algorithm for a virtual machine. Does the fact that it is a virtual machine mean that there are special limitations that I should be aware of? My understanding is that the...
In C++ there are a number of primitives that are not defined in terms of other types. By this I'm thinking
int a = 1;
char b = 'M';
float c = 3.45f;
short d = 0xC3A3;
Is it possible to...
I've been examining some compiled code with OllyDbg. I've noticed that I can see the names of classes, functions, and variables. Is OllyDbg extrapolating this information from my source code? Or,...
I have four source files. The main source file includes two other source files. The two other source files both include the fourth source file. In the fourth source file I have an include guard. ...
I am using the string to hold a file image. I am moving the image into the program after it has been compiled.
I would like to have a program with a 5 mb string embedded in it kind of like this:
const char *c;
c = (const char*)"BEGIN_STRING_HERE, (5 MB of arbitrary values here)";
Is it possible to...
I have a C program. Within it, I would like to embed either a file or a pre-assigned variable. I would prefer a method that is platform independent.
I am using the data type "RSA" from...
By this I referring to large software projects. For example, Windows OS is probably 50+ million lines of code. Any programmer hired to help maintain such a system would have to specialize in a...
I had a job interview several days ago. They have now asked me program a small puzzle game.
Although I anticipate that it will be less than 1,500 lines of code, it is still a substantial amount...
I'm trying to display double precision numbers in binary form so that I can manipulate them on the bit level. I'm pretty sure I've figured out how to display them in binary form, only I'm getting...
The code iterates in a tree like fashion. In the extreme case, the tree would only be 40 levels deep, so the memory footprint is relatively small. Each node on the tree though, would have 40...
But using goto will make my recursive function work in a way that is more similar to an iterating function.
I was thinking that each time the recursive function is called, copies of variable are...
I have a function that does a huge number of iterations. I suspect that the function calls themselves are resulting in overhead. I tried passing by reference instead of by value, but this slowed...
I think I phrease that poorly. I'm trying to find the largest possible value of my_output_double that results in a value of guessed_number <= limit_number
I'm trying to do a numerical search and I want to find the number exactly. Here is some code to illustrate my question:
long guessed_number, limit_number = 1000001;
guessed_number =...
That makes sense. It would explain why my program hasn't crashed.
I think I'm actually compiling this as C++. I'm using mkoctfile to compile, and the file I'm using ends in .cc.
When I tried to compile without the casting, I got some message about conversion...
Is it safe to declare an array of structures, if the strucure itself contains dynamically allocated arrays? Below is some sample code.
The program I'm working on seems to work, but I'm worried...
I had text parsing some luck using the Boost library.