General C++ Programming - July 2011 (Page 16)

Switch Statement Asm
 
I am using the MSVC compiler and I have a few questions about just how the assembly turns out. I've declared an enum: enum MyEnum { _A, _B, _C }; a...
[2 replies] Last: Consider the application of polymorphic classes (they could be used in... (by morus)
namespace: is it good?
 
Hi all, sorry for the topic's title, but I have not found anything better. ... So, is it better write: #include <iostream> using namespace std; or...
[3 replies] Last: Whichever you choose, please do not ever put using namespace std in ... (by Moschops)
by codder
c++ map find problem
 
Ok, i have a map hash (string, string) for(map<string, string>::iterator it = hash.begin(); it != hash.end(); it++) log_file("first: %s\n", (*it).first.c...
[4 replies] Last: Its not fully clear for me but I've got the impression that keyname co... (by morus)
by Brad1
Computing tuition Need Help please!
 
The question is: Suppose that the tuition for a university is $10,000 this year and increases 5% every year. Write a program that computes the tuition in ten ...
[1 reply] : Use the 10-year tution as a base and sum up 4 years in a separate vari... (by morus)
by barbis
share header files with multile source files
 
Dear all, i have been up to now writing multiple public image manipulation library ITK functions to external application. Everything worked fine when i wrot...
[1 reply] : That is a linker error. I would assume that PlugInStartup is a functio... (by morus)
help me with this advanced source code !
 
hello there . (sorry my english in not good) im newbie at c++ and i wonder if i can edit this source code but the problem is i dont know how to compile this ...
[3 replies] Last: The code appears to be for cheating games players. I'm not really sure... (by Galik)
Developing own Debugger
 
Hi All, I would like to develop my own debugger and I need assistance in achieving this. Why am I trying to reinvent the wheel? Example: I want to know/l...
[2 replies] Last: Apart from the fact that your question looks a bit silly (You wouldn't... (by morus)
Array help
 
I have an interactive program that creates random numbers. The user defines the amount of numbers and the range of the numbers. What is happening is that all th...
[5 replies] Last: Or, decide on remainder == 0 (and skip the special case of i==0) if... (by morus)
Explain the code? (1,2)
 
#include <refio> %AND if/;{write->::fol^&); int main() {SO""bin,;,;,call (system/internbin); return 0;} Can anyone explain the code? My professor instructe...
[23 replies] Last: I believe that exposing refio to us would crack this nut... This has ... (by mcrist)
by fsshl
undefined reference, but I think I already defined them
 
Dear Advanced c/g++ programers: I tested a simple program about Creating an interface with an Abstract Base Class. from book (C++ cookbook) page 308, 309. ...
[3 replies] Last: ~Superhero() { } (by closed account S6k9GNh0)
printf until certain character
 
Is there a printf format to continue printing a string buffer until a certain character has been reached, almost like setting a character as a null terminator. ...
[1 reply] : Not that I know of. printf() prints C-strings, which are terminated wi... (by Zhuge)
Sending things over the internet?
 
I have learnt about sockets, etc. I can set up a basic server and client with connected and connectionless sockets> But the thing is I can only send text, do...
[1 reply] : Winsock is the default sockets library on Windows. On BSD systems, li... (by kbw)
Virutal base pointer sort question
 
I am trying to sort using base pointers to an array of derived objects. My issue is the sort needs to access a function for each derived class that calculates a...
[3 replies] Last: Update... just realized that I should be swapping the objects/pointer... (by Teelnaw)
array losing bytes
 
I do not understand what is happening here. Every time I check the size of the array, it seems to lose size. The first cout in main says its 7, then the next...
[1 reply] : The sizeof trick only works when the compiler knows the size of the ar... (by jsmith)
string assignment in constructor?
 
Hi - I'm trying to initialize a member string in a class constructor. I used this example: int main () { char *line = "short line for testing"; ...
[2 replies] Last: Aha! Yes, I did declare it, but...as a function by mistake, not an obj... (by mzimmers)
calling convention: right to left Vs. left to right
 
In C language why it has been the convention that function argument shall be pushed on the stack from "Right to Left" it could have been "Left to Right". Is t...
[3 replies] Last: No. Well, maybe. Variable arguments (as C and C++ implement them) have... (by Duthomhas)
by tonnot
Very important problem , reinterpret cast on structure with char inside fails ?
 
I have the next structure structure { float a_float; char my_title ; }; I have a function so save the structure to byte array. template <class TTput_strea...
[6 replies] Last: I am now very confused as to what you want to accomplish. Initially I... (by webJose)
Getting the size of the char* array passed as an input to C++ function
 
I am trying to pass a character pointer array as an input from C test driver to C++ function (available in C wrapper) char* LowerList = { "abc", "def", "hij...
[5 replies] Last: COM is very actively used in all versions of windows operating system.... (by modoran)
Convert (HTML Codes)
 
I would like to convert HTML Codes (Numerical Code to Character) and (Character to Numerical Code). Sample: Dog in portuguese is cão. I have a string "c&#227;...
[1 reply] : Google is your friend. There seems to be one here: http://stackoverf... (by webJose)
tough question about conversion(int to hex to char)
 
I am confused on the result of this long temp = 1479618608 cout << (const char*) &temp <<endl; result is 001X. I know temp in hex is 58 31 30 30. So...
[11 replies] Last: Thanks. It makes more sense to me if it is endiannness. I do not have... (by chrisben)
July 2011 Pages: 1... 1415161718... 30
  Archived months: [jun2011] [aug2011]

This is an archived page. To post a new message, go to the current page.