General C++ Programming - December 2010

String Capitalization Converting
 
Currently, the only way I know how to convert a string to lowercase and uppercase are by: #include <algorithm> transform ( answ.begin(), answ.end(), an...
[7 replies] Last: Very much so! People like you who are willing to take a little time to... (by ProgrammingNoob)
bool beats int
 
Well, I'm testing the operator + function for my biginteger class, and so I wrote myself a little function to add by integer and one to add by biginteger. ...
[3 replies] Last: The penalty for integer to biginteger conversion is so small as it is ... (by Duthomhas)
Issue with iterators with stl set using a custom comparator
 
Hello, I'm trying to make a custom set that will only keep the highest n entries based on a custom comparator (if there is already a way of doing this with the...
[2 replies] Last: You can do it with the STL. http://www.cplusplus.com/reference/stl/... (by Duthomhas)
what does LEA directive do here?
 
I disassembled a simple C program: j = i = 2; s = ++i + j++; the assembly code's here: 80483c4: 55 push %ebp 8048...
[10 replies] Last: Just like guestgulkan, I have not met this order of operands before. ... (by simeonz)
by pizet
priority_queue
 
Hi, I know what's Heap, HeapSort, I know the ways of implementing this data structure. But know I would like to use the STL priority_queue instead, so that STL ...
[2 replies] Last: class mycomparison { bool reverse; public: mycomparison(const... (by pizet)
compile-time array initialization
 
Does the following initialize the FIB array during compilation? If not, how would I go about doing it? If yes, is there a better way? #include <iostream> ...
[10 replies] Last: That's very interesting. Thanks. (by m4ster r0shi)
How is better way to declare variables?
 
Hello everyone ... I have a doubt kind of dumb ... but still is a doubt ... What is the right way / better to declare the variables in my program? All at on...
[9 replies] Last: I recommend delaying the declaration as long as possible and initializ... (by moorecm)
by Icenel
Change Output
 
Hello, I want to ask some question... how to hidden output, change output into "*"(Any words would turn into "*"), but the meaning of * is not lost. example:...
[7 replies] Last: I disagree. Don't mix separate concepts. A "card" class should only... (by Duthomhas)
Using brackets ({ }) to create scopes?
 
Hmmmm I'm programming here and a "stupid" idea grow in my head... I can use brackets to create scopes on my program? Eg: ... int a,b,c; a=0,b=10,c=20...
[4 replies] Last: A so far unmentioned benefit is that C++ destructors are called at the... (by kbw)
ascending..
 
how to create a program that can sort it in ascending... ex: input a num: 12 31 4 1 8 output: 1 4 8 12 31 thanks! for those who give the whole program...
[4 replies] Last: @albatross... i cant translate it into c++... maybe i'll study it firs... (by deimon09)
Preprocessor Directives Isssue
 
Sup guys .. So , the thing is that i need to define a preprocessor directive so i can compile correctively an SQL pseudocode into C++ . VALUES (value1, val...
[1 reply] : please use the ' **code goes here** ' tags to help posters distinguish... (by kash kow ken)
by SK480
Anyone Willing to Mentor Me?
 
I really need a mentor. I can write programs in C++ (have made some text-based games). Now I want to move on to 2D games, and eventually 3D. However, I have no ...
[12 replies] Last: sadzuby@hotmail.com I appreciate this. (by SK480)
reverse
 
can you teach me how to do some program that can print the number 1-10 first five (1-5) and reverse the remaining (6-10).. ex. output: 1 2 3 4 5 10 9 8 7 6 ...
[10 replies] Last: ProgrammingNoob.. its advance study, so boring here at house. so i w... (by deimon09)
by big o
Error using template class instance as member of template class.
 
I came across the following errors while working on my personal project (simplified): ...: error: type ‘CustomMemberFunction<NumericRange<BoundType, Compa...
[2 replies] Last: That fixed it. The error message is particularly unhelpful. After ... (by big o)
by fafner
undefined reference
 
I know there are several other posts about this issue, but none of the ones I can find have been helpful. I'm trying for the first time to compile a fairly l...
[8 replies] Last: Dunno. If that is really an issue, compile like g++ *.cpp -c #just c... (by ne555)
Stack Overflow with recursion implementation
 
Hi Everyone, I'm having a pretty serious issue with stack overflow and recursion. I'm trying to solve Euler problem 14. My implementation works, but when I l...
[8 replies] Last: It's the sequence that starts with 704511. http://en.wikipedia.org/wi... (by ne555)
by Icenel
[Ask]Card combine and shuffle
 
Hi everyone. I got a problem with combine I have project to make card game without GUI(CMD view), for 4 players(me + 3 CPU) The card have 4 elements : Diamond...
[5 replies] Last: blackcode41 you are genius !! WOOO... You do not even use strcat or s... (by Icenel)
by akramm
I want to develop the program
 
hello i have a program but i would develop this program # include <iostream> using namespace std ; int main () { int a ; //we have to declare a variab...
[6 replies] Last: Just note that using the >> operator on an std::istream will not give ... (by Kyon)
fscanf problem
 
Hi everyone. I got a problem with, i suppose fscanf. I need to read strings from a .txt file, line by line, a total of 200 lines. But it seems that fscanf can r...
[5 replies] Last: OMG, i missdeclared pojmovi ... It should have been char pojmovi .... (by Nenad Zivic)
by Bazzy
backslash+newline
 
In C++ you can put a \<newline> anywhere in the source and it will be ignored eg: std::co\ ut << "hello \ world"; This is usually found in macros: ...
[4 replies] Last: Both in C and C++ it's simply ignored (by Bazzy)
December 2010 Pages: 123... 24
  Archived months: [nov2010] [jan2011]

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