General C++ Programming - May 2012 (Page 25)

using ||
 
so when using something like: if(answer="y"||answer="Y") can I just use: if(answer="y"||"Y") :P
[6 replies] Last: Let's look at order of operations to see why it doesn't work. In th... (by Stewbond)
std::set : no reserve() ?
 
Is there a reason as to why std::set has no reserve function ? Is it because of the implementation ? I noticed std::unordered_set has a reserve() function.
[no replies]
Difference between static variables and normal variables.
 
Hello , I want to know the difference static variables and normal variables. I am working on sdl game library in c++. This is my game loop for which I...
[1 reply] : Here's an example of a function that has a protection so that it is o... (by Stewbond)
Writing a binary search tree with templates.
 
In short, I'm trying to write a Binary Search Tree. I have a template class which includes the function definitions in an .inl file. for the purposes of keeping...
[1 reply] : I don't know what compiler you're using, but line 8 of the .inl should... (by Telion)
Detect Escape Key pressed
 
Hi, I'm writing a program and required to output "escape pressed" when escape key is pressed when the program is running. How would I do this? Note: I'm s...
[9 replies] Last: Thanks for the help codekiddy (by Dynamo9)
Calculate Geometric MEAN
 
Hello!I want to create a program in c++ which could calculate geometric mean for grouped data and ungrouped data.If any one know how to calculate Geometric mean...
[2 replies] Last: @atrium pfff ahahhahahhh :D @OP well you take the n-th root of all a... (by codekiddy)
is there any tutorial on creating cheat engines using C++?
 
is there any tutorial on creating cheat engines using C++? im planning to make a cheat engine but i dont know some things like, how to get the process or the w...
[4 replies] Last: the languages i know are: javascript C++ C# and GML nothing else... (by jamesguize)
Cue point timestamp from hex code
 
My project is to take a .wav file with 118 cue points embedded within it and extract the timestamp of each cue in the form of 00:00:00. The program that I write...
[no replies]
Unexpected Token Error
 
Normally I do fairly well when setting up a start-up menu, but every since I starting incorporating functions into my program as requested I have been having Un...
[1 reply] : Without regard to what your program is supposed to do: 1 . You have ... (by Alrededor)
Postfix Increment/Decrement Operator
 
Hello, I am currently learning about overloading the postfix increment and decrement operators. Currently, I am evaluating this code snippet from LearnCpp: ...
[10 replies] Last: Thank you very much. I think I understand now! (by Flurite)
Hexadecimal to UTF-8
 
Hello, I have a char with the value C5. I know that C5 in hex corresponds the value 197 in decimal. This number (197) corresponds to a character in ASCII ext...
[12 replies] Last: Thank you very much. It did work. All the best (by goncalp)
predicate logic in c++
 
I need help understanding the logic and what I might program to create the forAllForSome and the forSomeForAll functions. Any help would be greatly appreciated....
[2 replies] Last: Thank you! (by edithsong)
Need some help fast with Template in Double Linked List
 
Ok so i finally managed to finish a working DLL using only class...anyway now i have to use template. So here is what i tried: #include <cstdlib> #include <i...
[7 replies] Last: I just wanted a Double Linked List inherited(derived) from the Simple ... (by Adryanmh)
How do programmers use data structures?
 
I am in my first year of programming at a university and we are covering things such as linked lists, maps, binary trees, etc. Basically, what problems or s...
[1 reply] : I personally am no expert in C++, but from what I know various data st... (by Flurite)
by Snowzz
Need help with dynamic arrays
 
Hey new here, I need some help at the moment the code I have is: int main() { int numrec; int* records; cout << "How many records would you...
[10 replies] Last: More importantly, you need to learn to look up problems on your own. M... (by rollie)
empty for-loops purpose
 
Is it good to use empty for-loops as such: struct node *read_numbers (void) { struct node *first = NULL; int n; printf ("Enter a series of integers (0 t...
[1 reply] : i get it, it's just a loop so difference is rather than evaulate condi... (by closed account 4ET0pfjN)
by arooj
Connect Four Game board problem header file
 
How do I use the appropriate header file for this game? /* */ //board.h-calculates and displays the cost of laying sod #include <iostream> usin...
[1 reply] : Line 20 should define the type and size. Currently you define the ty... (by Stewbond)
Writing to Virtual Store Problem
 
Hi, In Windows 7, if you've admin permission, the files you try to write during runtime is written under the folder that .exe stays. If you don't have admin ...
[1 reply] : Right click on your project in the "Solution Explorer" and select "Pro... (by Stewbond)
(SOLVED) Help Sorting List of Pointers by Derived Class Member
 
Hi. I am just getting into using STL and am having issues with sorting lists of pointers based on values of derived class members, when I took my C++ class ...
[4 replies] Last: Thanks JLBorges! I had to change a few things around to get it working... (by Code2Code)
constant reference
 
Hello forum, I am having problem with the constant reference issue. The line that gives error is as follows: Ray *r = new Ray(is.mPosition,importanceS...
[4 replies] Last: If there are 2 constructors(or any functions) that have the same name ... (by viliml)
May 2012 Pages: 1... 2324252627... 41
  Archived months: [apr2012] [jun2012]

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