General C++ Programming - February 2011 (Page 4)

Specializing char_traits with your own char type (UTF-8 issue clear-up)
 
I know UTF-8 question have been asked probably from the very dawn of C++ time and that someone probably has answered this, but no googling has so far provided m...
[3 replies] Last: LOL, it isn't that complicated. Most of the grief comes from being for... (by Duthomhas)
by Solrac
Need to access Oject returned as answer to function as pointer
 
I've been working on this two days and I have'nt figured it out so I decided to put all the code here and ask for help. I have a class NonlinearSolver that has...
[3 replies] Last: I do have functions in solutionNLE to communicate the answers (lines 4... (by Solrac)
compiler mystery...weird
 
I was trying to compile a very basic test program that was less than 170 lines of code. I kept getting "Expected unqualified id before "if"" errors. I went thro...
[8 replies] Last: Hmm, didn't know that forward slashes did that. That explains everythi... (by ModShop)
eof() problems - doubling last value
 
Here is me code: // Read from file then display Loan while (!loanf.eof()) { loanf.read(reinterpret_cast<char*> (&newLoan), sizeof(Loan)); displayLoa...
[2 replies] Last: Thanks Bazzy, worked like a charm! (by kraigballa)
convert char * to double?
 
Can it be done? Can i convert a char * to a variable? The reason is that i have a function that extracts 2 numbers out of a string (separated by a ",") using s...
[13 replies] Last: You can put also streams in a condition if ( ss >> x ) // ... el... (by Bazzy)
MY CODE KILLED MY COMPUTER!!!!!
 
I wrote a recursive function to solve for a number in the Fibonacci sequence: fib(int num) { if (num == 1 || num == 2) return 1; return fib(num-1) +...
[15 replies] Last: His code doesn't kill my computer, but mine is linux. (by rocketboy9000)
by Solrac
solved
 
solved
[1 reply] : Just a guess, SolutionNLE::getSolution() needs to be declared like thi... (by PanGalactic)
error in 'if' checking
 
#include <stdio.h> int main (void) { int x = 0; float y = 0.0; scanf("%d%f",&x, &y); if (!( (x > 0) && (x<=2000) && (y>=0) && (y<=2000) ) ) ...
[2 replies] Last: Thanks!! Didnt know integer truncation was done this way. (by acpaluri)
by gibble
[VS2008] Cannot compile in debug mode, works in release.
 
I have a visual studio 2008 project that I am working on for school. I've nearly completed it, although for some reason that is beyond me, and my instructors th...
[3 replies] Last: Thanks, I managed to get around it by importing the project into VS201... (by gibble)
mmn
 
nbn
[2 replies] Last: You have failed to open and read the contents of the filename entered ... (by mikeofthenight)
Create Binary I/O file
 
I've been looking into accessing, writing, and editing .dat files. How do you check to see if a file exists, and if not then create the file? fstream bIO;...
[3 replies] Last: There isn't a good way to determine file size using standard C++ but t... (by Bazzy)
ext/hash_map Multithread
 
I'd like to craete multithread program which uses hash_map ( hash_map<int, vecotr<void *> >) . I have 8-core machine so I don't want to lock hash_map every inse...
[2 replies] Last: I want to lock hash_map before insert Something like that has... (by phenomen1)
Count the occurrences of "ALL" matching words in an user input sentence?
 
Hello everybody, Sorry to be back so soon with problems but this has totally worn me out. I worked to build over a 100 of test files from arrays to vector a...
[4 replies] Last: Nevermind .. From all I tried today it seems that this is going to tak... (by sharris)
NonSensical Compile Error
 
Hello, I'm getting only a single compiler error when I try to compile a chunk of code, coming from a template definition, for perspective I will include functi...
[2 replies] Last: Nailed it, the other functions weren't returning errors as I had nothi... (by bewers2)
Macro Expansion Question
 
Hello, I have an option of calling one of two functions from a library, say blah_32f(parameters) or blah_64f(parameters) Where blah can be any of a la...
[1 reply] : The best that I am aware that you could do is smth like this: #defin... (by simeonz)
Errors when porting from MSVC to GCC
 
Due to the project I'm working on, I'm required to use a GCC compiler. The problem is, it's giving me some strange errors when compiling the code I've written ...
[4 replies] Last: The problem is that you can not provide temporary objects when the par... (by simeonz)
homework please due in an hour thirty
 
okay i have actually tried and here is the prompt and my code: Write a program that reads student information from a file (one student per line) in the for...
[no replies]
assignment due at 12 i have done most of the work just a few errors
 
yes guys this is hw but really i have done most of the work but i just have not mastered it enough to solve this here is the question and the code i have. Pleas...
[2 replies] Last: you gotta help me out this is 2.5 points out of a hundred im pretty d... (by closed account D9hk4iN6)
trying to learn c++ and now im stuck
 
OKAY SO I AM TRYING TO LEARN C++ AND I HAVE COMPLETED FOUR OF THREE OF THE FOUR ASSIGNMENTS FOR THE UNIT. nOW I AM STUCK ON THE LAST ONE AND I NEED HELP FIGURIN...
[no replies]
How to make a general query function using ODBC
 
Hello, and thanks for reading! I'm a bit stumped on my current task after searching online and trying various ideas. I'm down to just a few lines of code that I...
[14 replies] Last: I'm not suggesting the final solution be done using a VARIANT. I want... (by kbw)
February 2011 Pages: 123456... 25
  Archived months: [jan2011] [mar2011]

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