General C++ Programming - October 2011 (Page 3)

converting for loop to while loop
 
hi, can anyone help me? i can't seem to convert my loop. this is my for loop int i = 1; const char square = '&'; for (int i = 1; i <= n; i++) { ...
[3 replies] Last: FOR: const char square = '&'; for(int i = 0; i < n; ++i){ cout <... (by ciphermagi)
by Mathes
smallest double value greater zero
 
Hello, a few days ago i was wondering what the minimum value greater 0.0 is, that a double can represent. i checked std::numerical_limits< double > . but i ...
[4 replies] Last: Floating point representation is usually in normal form, a bit like sc... (by mik2718)
Help with merging files
 
I am new to this so please go easy on me. I have to merge sorted files in a directory.The files contains two strings per line and I have to merge on the first ...
[4 replies] Last: here's what I have #include <queue> #include <vector> #include <ios... (by mik2718)
cannot convert string to char error
 
iam getting this error for argument 1. error: cannot convert ‘std::string’ to ‘const char*’ for argument ‘1’ to ‘int strcmp(const char*, const cha...
[2 replies] Last: Also, strcmp doesn't take a char. Did you mean to use a char* for sec... (by andywestken)
Brace Initialization syntax
 
Hi, Did you know that C++11 (which is now the official ISO standard for C++ compilers) provides a new way of initializing objects using braces? Even if you kno...
[1 reply] : Indeed, I initially underestimated the usefulness of uniform initializ... (by Athar)
DATE in string
 
Let say I have a string which is 2011-2-3 , how do I convert it into days in 365 in 2011? How do I use find function and substr function in this case?
[1 reply] : assuming that the string is constant, and you're using ctime http://ww... (by Ng Han Seng)
Math Question [FPS Prediction]
 
I know how to do latency prediction and speed prediction (quite obvious.) I'm a little confused about frame rate prediction though. Obviously if a client has 30...
[no replies]
by mr tom
minesweeper PROBLEM
 
Hello this is my first post I have been doing some of the problems on a site called programming challenges <http://www.programming-challenges.com> and I am ...
[no replies]
evaluating a expression
 
int k =8; int b = (k++ -k++ - k++); how this expression is evaluated?
[4 replies] Last: Google around "sequence points". Parentheses do not indicate sequence ... (by Duthomhas)
pthread error
 
How do i Add -lpthread to Codelite compile options. can anyone assist, please
[no replies]
Command prompt isn't working
 
Anytime i compile and run any code, the command prompt window will pop up and down in a quarter of a second or so, even if i say system("PAUSE") or have a loop ...
[1 reply] : http://www.cplusplus.com/forum/beginner/1988/#msg7262 (by ciphermagi)
Checking the contents of a template object.
 
I've updated the title of this thread to indicate the direction that it started going. I'm making a logging function for which I'd like to add a timestamp ...
[6 replies] Last: sizeof() is a string function. You'll have to typecast anything that y... (by ciphermagi)
B plus tree delay split algorithm question (not asking for code just advice )
 
Hello, my task is to create a b+ tree implementation of order 3 ( order 7 too but I will use 3 in this example) Currently my code creates a Btree and im workin...
[no replies]
What's good about using switch?
 
I just notice that it's used a lot. It seams more convenient and intuitive to just use a series of if statements. Is there any reason why a switch statement m...
[5 replies] Last: I think it would be better to use a switch there. It makes more sens... (by ciphermagi)
Help with Opening files
 
I am trying to open all the files in the directory to process them but the files are not opening. Can anybody point out the errors in my code? void m...
[no replies]
Problem with list<class>
 
Hi peoples. I'm making a program that enters a person requests a list using list <class>. My code creates a person object without error, creates the requested o...
[6 replies] Last: hi guys. Thanks for all help. The problem is when I insert the second ... (by muttleydm)
by RGB
Filling an array with random numbers using srand(int(time(0)))
 
I have searched the internet and have not been able to find a definitive answer. I have a general idea but when trying to return the values to the array it out...
[16 replies] Last: I'm not exactly sure what you mean by not giving menuchoice a value b... (by shacktar)
by Icenel
If else shortcut
 
is this true ? // input price // when price >= 90000 give 20% discount // suppose the input price is 100000 then i do this #include <iostream> #include <str...
[1 reply] : cout << (price >= 90000) ? cout << (price / 5) * 4 : cout << price <<... (by Ng Han Seng)
by RuiJ
C++ Linker error
 
I get this error when i compile my project and it's related to these three pieces of code I'm very confused Prompt.cpp: #include "CalcularTamanho.h...
[1 reply] : You shouldn't (usually) include a cpp file in another cpp file Move t... (by andywestken)
Need help
 
I have this lab I am working on but I have no clue what to do after. Its my first lab and it seems pretty hard to do. Also I am still rusty with c++ as well. T...
[2 replies] Last: I have the same assignment, its kicking my ass!. (by PorkChop)
October 2011 Pages: 12345... 36
  Archived months: [sep2011] [nov2011]

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