General C++ Programming - October 2013 (Page 11)

by zombie
... and the preprocessor?
 
Depending on if #define _MODE_1 is set I want to call different versions of a function. At the moment I use #if defined _MODE_1 myfunction(x,a,n,...); #...
[4 replies] Last: @Framework: Thanks, that solves the problem. (by zombie)
by Ceset
could not convert
 
hi i m working on a wrapper function here is the code void fge_RenderCopy(SDL_Renderer * renderer, SDL_Texture * tex, SDL_Rect srcRect, SDL_Rect dstRect...
[4 replies] Last: well what if i say no what could it be. even the debugger says fine ... (by Ceset)
recursive call and placing strings in link list notes
 
You need to write a permute class that will take first and second strings to rearrange letters in first, followed by second. For example, if the first is “CAT...
[no replies]
Sorting a string array
 
Okay fellas, I have been reading up on arrays and string array and I have a question I cannot seem to find the answer to. I created a string string text a...
[9 replies] Last: Thanks a ton for that... Before I tried making it a function, I just h... (by MJGilbert)
Separating routines into a separate implentation and header file
 
I am trying to separate out particular sets of routines into a separate implentation and header file which can be compiled independently to the main program suc...
[6 replies] Last: Thanks Doug4, got it sorted :) (by bennyjammin)
Help!! Getting perfect numbers from two values.
 
Find the perfect numbers between a starting value and a finishing value entered by the users. Display the results to the screen. YOU MUST DESIGN YOUR SOLUTION W...
[3 replies] Last: Thank you! (by TubbyKustard)
by Tresky
Constructor vs. Object.Create()
 
Which method of creating an object would the best? I've seen people who create objects using the constructor alone and I've seen people who use a Create() metho...
[5 replies] Last: It's not a valid complaint, it's the necessary and expected part of R... (by Cubbi)
PLEASE HELP sort object vector
 
Hi, I'm newbie with C++ and I found an example which I need http://ideone.com/Eikbr4 But I've a question, how do I seperate this piece of code into .h and .c...
[1 reply] : You're going along the right lines. But why do you have all those glo... (by MikeyBoy)
Random Num Generator
 
Hello, I am trying to make a random number generator to simulate a critical hit if the number generated is from 0-critical amount. However, every time i run th...
[6 replies] Last: @condor @MikeyBoy Thanks mates, I guess thats why you don't program a... (by CloudIsland)
Determining Size of Array
 
Hello Everyone, char A ={}; this is the array in c++ of unknown size, now I want to enter some alphabets via loop and want to be the no. of elements i entere...
[8 replies] Last: thanks a lot for the suggestions, strings solved my problem and also r... (by saratirmizi)
by mjyz
Trying calculations from file
 
///
[3 replies] Last: Now the problem is that you calculate the average but not the sum devi... (by coder777)
Need help with defining a class type
 
I am currently working on a program that reads through an XML file and picks out the opening tags and closing tags. I am pushing the element tag name onto a sta...
[1 reply] : Firstly, please use code tags when posting code, to make it readable. ... (by MikeyBoy)
what is the problem with this function?
 
bool & operator == (point_t & p1, point_t & p2) { return ((p1.x==p2.x) && (p1.y==p2.y))?true:false; } this one got problem: error: initial value ...
[2 replies] Last: Neither of your implementations will be any use. In the second one, y... (by MikeyBoy)
by JLJ
Arrays, min/max values, etc.
 
The assignment: In a gymnastics or diving competition, each contestant's score is calculated by dropping the lowest and highest scores and then adding the r...
[1 reply] : #include <iostream> #include <iomanip> #include <string> #include <fs... (by Yanson)
I am so stuck.
 
Could someone please show me how to create this? Our instructor gave us this lab to do, but he teaches us how to do them after the due date. I really have no i...
[5 replies] Last: Copy-paste without comprehension is not safe. If the teacher really d... (by keskiverto)
How do I create an algorithm for the following conditions?
 
I am writing a code for an online store. It's a school assignment. Here are the conditions and price: Each DVD is $20.00 Every 6th DVD purchased is free. ...
[4 replies] Last: if (numDvds/6 >=1) { ******* } else price = numDvds*20; (by joelsanz)
Templates in C++
 
Hello, I'm currently learning templates -- & my logic is in a knot with what I am trying to do which is the following: -Create a function name load -Accept...
[2 replies] Last: you saved me from the abyss : ) Thank you kindly. (by closed account S3TkoG1T)
by CroCo
Round Off error?
 
I came across the following code http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/ #include <iostream> int main(void) { float fVa...
[2 replies] Last: You can't because 2.468 cannot be stored in the amount of space alloca... (by Zhuge)
Cout is Ambigious?
 
Im just an idiot. problem solved :)
[1 reply] : Please don't paraphrase the error. Please post the actual error messa... (by Disch)
Program
 
I need to write a program that can calculate fractions. All set
[2 replies] Last: You don't need to return them. Problem is (I think), that you never us... (by Icedoe)
October 2013 Pages: 1... 910111213... 46
  Archived months: [sep2013] [nov2013]

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