What is the output of this program?
Hi, when i tried to run compile and execute this statement in a simple c file: main(){ printf("%d");} on HP it's is giving me 64 and on AIX its giving me 804359524. Could anyone tell me what is this behavior. ...
Hi, when i tried to run compile and execute this statement in a simple c file: main(){ printf("%d");} on HP it's is giving me 64 and on AIX its giving me 804359524. Could anyone tell me what is this behavior. ...
When compiling my code with the GNU C++ compiler I get something like bla.cxx: In function `int main(int, const char**)': bla.cxx:110: error: no matching function for call to `func(const classA*&, const classB<classC>*&) const' someheader.h:321: note: candidates are: bool func(const classA*, const T*&, const std::string&, std::string&) ...
I'm trying to create a function that takes the name of a directory (C:\foo\bar, or ..\foo\bar\..\baz, or \\someserver\foo\bar), and creates directories as necessary so that the whole path is created. I am attempting a pretty naive implementation of this myself and it seems to be a string processing nightmare. There is / vs \, there is ...
Hello, I am just wondering why programmers who program in C++ for windows always use Visual Studio 6 instead of Visual Studio 2008? Isn't the compiler in 2008 much better than the one in VS6? The reason I ask as I have used many sdk's that are always written in VS6? Many thanks, Steve ...
I have a point at 0,0,0 I rotate the point 30 deg around the Y axis, then 30 deg around the X axis. I then want to move the point 10 units forward. I know how to work out the new X and Y position MovementX = cos(angle) * MoveDistance; MovementY = sin(angle) * MoveDistance; But then I realised that these values will change because of ...
I have handle of a text box and want to trigger an event in ATL c++ on any text change in text box. ...
I have a 2D MxN grid (or matrix). The cells in the matrix may hold an integer. A cell with a non-zero integer is said to be populated. The set of populated cells in the matrix is known as a "configuration". I want to come up with an encoding or hashing algorithm that wil allow me to uniquely identify a configuration in the matrix, by co...
I wrote a test to check whether destructors were called before an overwriting assignment on a stack variable, and I can't find any rational explanation for the results... This is my test (in Visual C++ 2008 Release mode): #include <iostream> class C { public: char* ptr; C(char p) { ptr = new char[100]; ptr[0] = p;} ~C() { std::cout ...
My problem is "how to know which menu item is clicked in visual studio 2005". i wrote some code using hook for monitoring WM_MENUSELECT..it is working fine for notepad,visual c++6.0 applications but when i use this code for VS-2005 it is not woking(these type of msgs are not generating when i click menuitem in VS2005).. is there any...
I initialize an auto_ptr to NULL and later in the game I need to know if it has NULL or not to return it or a new copy. I've tried this auto_ptr<RequestContext> ret = (mReqContext.get() != 0) ? mReqContext : new RequestContext(); And several other similar stuff casting and so, but g++ tries to invoke auto_ptrs nonexistent operator? (...
Hi, how to get the process ID and handle of a process by its name in win32(windows-mobile). i mean if i pass the process name i should get id.. how to do this.. Thanks in advance. ...
I need to convert a string to a char * for use in strtok_s and have been unable to figure it out. c_str() converts to a const char *, which is incompatible. Also, if someone could explain to me why the second strtok_s function (inside the loop) is necessary, it'd be a great help. Why do i need to explicitly advance the token rather tha...
I need to search through a DAG graph, but I don't want to advance past a node before I have seen all of the other nodes that have directed links pointing to it. Is there an existing algorithm to handle this particular situation, the depth first search and breath first search don't work for this order of traversal. Ie: A -> B B -> C C ...
I recently had a problem creating a stringstream due to the fact that I incorrectly assumed std::setw() would affect the stringstream for every insertion, until I changed it explicitly. However, it is always unset after the insertion. // With timestruct with value of 'Oct 7 9:04 AM' std::stringstream ss; ss.fill('0'); ss.setf(ios::right...
Hey, I have a Java program that calls a C++ program to authenticate users. I would like the program to return either true or false, and if false, update a pointer to an error message variable that i then can grab from the Java program. Another explination: The nataive method would look something like this: public native String takeIn...
Does anyone know how I can use an HBITMAP variable to write a png or jpeg file? I first looked into doing this with GDI+ but it gives me errors telling me min/max haven't been defined (defining them just brings more problems), I then looked into libpng's C++ bindings (png++) and couldn't get the examples to compile. thanks, Mikey ...
Hello, i have a library written in C++, how can i create bindings to C# so i can expose the functionality of that library to C#? And i don`t mean "port" (using SWIG possibly). I mean that when calling some functions in C#, pure C++ code is executed so it is fast. I've searched around in google but i couldn't find anything o_O Thanks in ...
Could anyone please provide me a sample C/C++ code to read and edit PDF Metadata? If it is XMP, what else to do? Thanks, Suranjit Paul ...
Is it possible for a C++ application running on Windows to drop privileges at runtime? For instance, if a user starts my application as Administrator, but there's no reason to run my application as administrator, can I in some way give up the Administrator-privileges? In short, I would like to write code in the main() function which d...
We have an upcoming project to allow an old platform that's only extensible with C++ / VS 2003 to call a SOAP-based web service that uses WS-Security. My Google research indicates that gSOAP could be the best way to go. I'm looking for validation and/or alternative suggestions. ...