General C++ Programming - February 2009 (Page 12)

by daula7
Multimap Memory problem??
 
I'm trying to read a flat file, load data onto a structure and then insert the structured data into the std::multimap. The problem is that the input data fil...
[7 replies] Last: By the way, I just took a better look at your code, and it sucks: ... (by daula7)
Problem with Time Program
 
Hi, I have a program which is supposed to give the time elapsed from a given time to another given time. There were three functions which were incomplete setTim...
[5 replies] Last: Your display1Time function is printing the time twice, once in the if-... (by jsmith)
If you had to choose between (1,2)
 
Alright so I just started class again but this time the tutor is using http://www.cplusplus.com/reference/clibrary/cstdio/ instead of http://www.cplusplus.com/r...
[24 replies] Last: I see - Agreed. (by Mythios)
by Nobun
Linux static linking
 
Ok this is not related directly with programming, but however it is an important part. Most of times dinamic link is the better choose (and works fine). B...
[5 replies] Last: But, in linux, a binary cannot be read in more machines and must be r... (by Nobun)
About making a .exe load elsewhere
 
Ok so what I mean by this is say in C++ I want to make lets say a KeyLogger. I'm fine with all the programming to do so for recording all the strokes and output...
[10 replies] Last: Hey thanks for that. This looks quite interesting - thanks I'm reading... (by Mythios)
by psault
concat macro
 
Hi programmers! I'm wanting to know how, if there is a way, to "build" variables through a loop. I'm not interested in using an array. This is an example o...
[9 replies] Last: Yes, an std::map<int, void(*)()> seems perfect for this. (by helios)
"new" type determined at runtime?
 
I have several classes, which we'll call classA, classB and classC to keep things simple, all of which inherit from a single class, which we'll call baseClass. ...
[1 reply] : Nope. That's exactly how it's done. (by helios)
Meta-programming, templates, virtual functions
 
Hello, I have a structure similar to the one below.I miss a lot of information about the specific template parameters, so I would need something like what is...
[no replies]
by Malang
Can SomeBody Explain to Me...
 
Question # 1: int b ={1,2,3,4,5}; int j=0; for(int i=0; i < 5;++i) cout<< b[j++] << " "<<j<<" "<<b <<" "<<endl; The output of this program is : 1 1...
[4 replies] Last: has a higher precedence order than =. This is the resolved order of ... (by helios)
return
 
Does return instantly end the execution of the function at that spot and return to the "outer" function which executed the "inner" one? int Function() { ...
[2 replies] Last: Any decent compiler with warnings turned on should give a warning such... (by jsmith)
Problem with number finding code
 
I need a program to find the largest number out of a known set of numbers for A (I got that part working correctly, and the smallest number for an unset amount ...
[7 replies] Last: while (input != 'C') just make input a char. that might be it?... (by djlethal109)
Problem with Fabs
 
I dont understand why a simple function 'fabs' is not working when I use a double argument d_bend!!! It works only when I typecast it with 'long' as done below....
[8 replies] Last: Guys, I am really sorry. Have found my mistake, it was more down to... (by luckycusp)
Removing spaces?
 
I'm writing a program and part of it requires me to remove a bunch of spaces from the beginning of a string but still keep all the remaining characters. Everyt...
[5 replies] Last: http://en.wikipedia.org/wiki/Whitespace_(computer_science)#Unicode ... (by helios)
cin & getline
 
I'm using getline: cin.getline(c.buffer, sizeof(c.buffer)); My program works fine except I'm having one problem I can't seem to figure a way around. It's ...
[6 replies] Last: Well I've tried the last thing you suggested, no change. Initializing ... (by mrdahjr)
Ignoring Last K-Lines of A File
 
Hi all, I have a file that I want to process except the last K lines. The data looks like this: foo bar qux hum nid Surely the actual dataset ...
[4 replies] Last: Sorry, I didn't see the amount of lines. No, jsmith method only kee... (by helios)
why no worky?
 
hi! i just started programming and am taking a class, im wondering if you could help me understand why this if statement crashes the program. i include some lin...
[3 replies] Last: That link perfectly identifies and solves your problem :) (by Zaita)
Someone tell me what I'm doing wrong here?
 
Alright so I can get this working fine if i take out the code from SetNumberOfEnemies() and put it inside StartUp(). But now that it's in its own function it'll...
[6 replies] Last: Ah yes, I see what you mean. Thanks a heap for that help Zaita. Tha... (by Mythios)
to swap elements at iterator positions
 
hi, i have 2 iterators and i wan tot do a bubble sort. i am getting a segmentation faut here because i think that the swapping has some error. structure is...
[5 replies] Last: i tried using sort too...... i implemented the custom function too....... (by bbarodia)
reading an entire txt file to memory
 
how would I read an entire txt file to memory at 1 shot? and how would I know the amount of memory to reserve to store the data, etc?
[3 replies] Last: At least on Unix you can use stat or fstat function to get size of the... (by Valery Reznic)
Looking for a header file I can't find?
 
Hey guys, I been told of a file something in the lines of "kbith.h". This header from what I know has: isKeyUp - isKeyPressed sort of thing. I'm using visual...
[3 replies] Last: Yeah! - thanks so much Scipio. It did exactly what I needed it to do. ... (by Mythios)
February 2009 Pages: 1... 1011121314
  Archived months: [jan2009] [mar2009]

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