Iteration to Recursion
Possible Duplicate: Can all iterative algorithms be expressed recursively? Is it always possible to convert a iterative function in a recursive function? ...
Possible Duplicate: Can all iterative algorithms be expressed recursively? Is it always possible to convert a iterative function in a recursive function? ...
I have a C++ library (.h only) that contains the implementation of a data structure and I'd like to use it in my iPhone app. Firstly, I wrote a wrapper in objective-C++ as a class that, through composition, has an ivar of the C++ class. I then was 'obliged' to change the wrapper class extension to .mm, and it seemed fine. But then I ha...
I'm starting an Explorer.exe instance with CreateProcess (flags NORMAL_PRIORITY_CLASS + DEBUG_PROCESS + DEBUG_ONLY_THIS_PROCESS), and then I'm doing this: procedure FakeDebugProcess; var wDebugEvent : DEBUG_EVENT; begin fillchar( wDebugEvent, sizeof( wDebugEvent ), 0 ); repeat if WaitForDebugEvent( wDebugEvent, INFINITE ...
In Microsoft Visual Studio 2010, I use the wizard to create a solution with two projects: - theapp: a C++ Win32 console app, and - thelib: a C++ static library I add an h-file and a cpp-file to the library and write a do-nothing function in thelib. In main(), I call thefunc(). In project/dependencies theapp is set to depend on thelib...
Hi, Very basic question coming up. I wonder why the name after the #ifndef directive is always all caps and don't seem to match the name of the actual header file. What are the rules surrounding this? I've been looking around the webs but, I haven't found any explanation for this. If my header file is called myheader.h would it then be ...
hey everyone :) i am a new programmer in c++. and i am using templates for the first time. i have an abstract class and another class extending it. but all the protected members of the abstract class are not recognised by the other class: class0.h: template<class T> class class0 { protected: char p; public: char getChar(); }...
i don't need tutorials talking about fvf or how to draw a triangle.... i need some advance stuff like meshes shadering........ that are free. ...
one story for each answer ...
Greetings, I hope someone has the patience to read this. I have a setup at hand, which is slightly confusing me. I have a C source code directory generated by an Eiffel Compiler. I want to use this output from Java, so I need a DLL for JNI, in which I'll implement some JNI functions. When I compile the C code, it gives me a static libr...
hello, i'm working on eclipse inside ubuntu envaironment on my c++ project. i use itoa function (that works perfectly on visual studio) and the compiler shouts that itoa is undeclared. in included <stdio.h>, <stdlib.h>, <iostream> and nothing help. can someone please help me with this problem thanks allot. ...
I know I can do class Foo; and probably struct Bar; and global functions bool IsValid(int iVal); What about a typed enum? What about a typed enum within an undeclared class? What about a function with an undeclared class? What about a static member within an undeclared class? What about these within an unknown namespace? Am...
Hi, In C++98/C++03, there are no pure/const function keywords in the language. Has this changed in C++0x? If so, is it possible to set such a flag even on function objects (std::function)? So I can pass some function pointer or lambda functions and additional give the information that it is a pure/const function? The called function m...
i want use dll made in c#(visual studio 2008) in c++ project(visual studio 2003). how to do that ? please heeelp ...
In my program I'm cutting my char* with strtok. When I'm checking on Windows it's cut like I want, but when I'm doing the same thing on Linux, it's doing it wrong. Example : Windows: my char* (line) is : "1,21-344-32,blabla" in the first time I do strtok I get "1" in the second time I get "21-344-32" Linux: my char* (lin...
This is a follow up to this question. Since, it I can't use GLUT to undecorated windows is there a cross-platform (which should include Mac, Windows, and Ubuntu at minimum) library or way to undecorated a window? I know there are ways to do this for individual operating systems but, I wanted a cross platform way to do it, so I looked at...
im trying to do something here but that error shows up i really have no idea how to get it done right i tried to put all the variables in the Figure.h as GLfloat instead of just float and the same error keeps appearing any idea? here is my Figure.h Class Figure { public: Figure(float x,float y,float z); void Paramete...
I'm getting a segmentation fault on this statement, when I comment it out I don't get a segfault: this->rows += 1; The whole method is like so: template <class T> void Table<T>::push_back_row(std::vector<T> & vec){ //Create a new row structure T ** temp; temp = new T*[this->rows+1]; for(uint i = 0; i < rows; i++){ //Rese...
I'm getting the following error when I compile the following code on Visual Studio 2008 / Windows SDK 7 const UINT a_uint; UINT result; throw std::runtime_error( std::string("we did ") + a_uint + " and got " + result ); Ironically, I ended up with this result: error C2782: 'std::basic_string<_Elem,_Traits,...
hi im trying to pass some values to a class but it wont let me it says invalid use of class 'Figure' im trying to send 3 values x,y,z and thats all but it wont let me heres what im trying to do... here is the main.cpp and the function that calls the class Figure for (j = 0; j < num_elems; j++) { /* grab and element from the file ...
Can I change the code, so that the VS2010 compiler's error message points to the offending line of code? class NoCopy { //<-- error shows up here NoCopy( const NoCopy& ); //<-- and error shows up here NoCopy& operator=( const NoCopy& ); public: NoCopy(){}; }; struct AnotherClass :NoCopy { }; //<-- and error shows up here int...