Beginners - February 2012 (Page 49)

Awkward question about writing longer programs.
 
I've been working on a text based RPG for a couple of weeks now, even though this exact version likely won't be finished. I started with a simple menu, then I'v...
[3 replies] Last: Create the class'/structs within main and then pass them to other func... (by Lynx876)
by Ilhan
First C++ Attempt/Total Noob
 
Hey there, guys. Very first time doing any type of coding, literally started watching videos yesterday. So this is a very basic problem.. I've used google to tr...
[12 replies] Last: Yes, but it is often unclear from just that line whther the loop goes ... (by LB)
istream >> operator
 
Consider the following snippet: void readFromAFile(string filename){ ifstream is(filename); char ch; while(is){ is>>ch; cout<<ch; } } ...
[3 replies] Last: You're welcome! Happy coding (: (by Lynx876)
I have a weird line printing and cant find it
 
I know this is a simple mistake but I think I am snow blind at this point. I am getting a "garbage out line " at the head of my second print function. Any ideas...
[2 replies] Last: Works fine for me too. VS Express 2005. (by cnoeval)
I have a weird line printing and cant find it
 
I know this is a simple mistake but I think I am snow blind at this point. I am getting a "garbage out line " at the head of my second print function. Any ideas...
[2 replies] Last: Duplicate post: http://cplusplus.com/forum/beginner/61334/ (by cnoeval)
What is the point of this kind of private data?
 
Hi, While I read about classes in C++, I often see examples like this: class Something { public: void setTheThing(string thing); string g...
[8 replies] Last: The only way for Magikarp to become Gyarados is through evolution E... (by yasar11732)
C++ Game Specification Help PLEASE
 
Hi members, I have made a game in C++ and I need to do specifications for it. Is there any example please on how to create specifications of a game please. Woul...
[2 replies] Last: Thanks very much you were of really great help my friend. Thanks again... (by orangeapple)
How to stop overflowing here?
 
When I run this program: #include <iostream> #include <cmath> using std::sqrt; class point { public: point(int,int); int operator...
[4 replies] Last: The ^ operator is bitwise XOR, not exponet That would explain the... (by yasar11732)
help with passing the right parameter
 
Ok so I have a function definition like this: int betterRunner(const Trunner *runner1, const Trunner *runner2); in main I have something like this Trunner = ...
[5 replies] Last: Post your code in code block. [ code][/code ] removing the leading an... (by clanmjc)
by lql44
what does the "final" mean?
 
I find the following line at the end of an class in Java: public static final double minutesamples = Math.sqrt(60 * 24 * 252); I am trying to conver...
[1 reply] : Try reading this: https://en.wikipedia.org/wiki/Final_%28Java%29 (by yasar11732)
by lql44
double MyValue = 0.02425D;
 
Hi All, In Java, I put a D at the end of a number to make it a double, is there a equivalent in C++? double MyValue=0.02425D; Txs
[2 replies] Last: Just leave out the D and it will be a double. (by Peter87)
by lql44
Length of Array
 
Hi All If I am passing an array to a function, is it possible to get the length of the array in the function? I tried the following but it didnt work ...
[4 replies] Last: [quote=Nahiyan]And sizeof is a preprocessor function, meaning it is re... (by Peter87)
Adding limits to user input
 
I have been searching a lot on this forum, and it seems there is multiple topics around this, however, I try and do the exact same as some of the guides that ar...
[no replies]
by lql44
Double.NEGATIVE_INFINITY
 
Hi ALL are there equivalent in C++ for Double.NEGATIVE_INFINITY,Double.POSITIVE_INFINITY and Double.NaN in Java? Txs
[1 reply] : If std::numeric_limits<double>::is_iec559 is true, then: std::nume... (by JLBorges)
Implementing ArrayList in C++
 
I'm trying to implement my own ArrayList in C++, and I can't get past syntax errors in order to complete the program. Here is what I have so far, and it is unde...
[11 replies] Last: Your header.. .h #if ndef _ARRAYLIST_H_ #define _ARRAYLIST_H_ #inclu... (by clanmjc)
Q's on File Processing
 
Let say i have many names in a txt file together with their scores respectively. How do I write those inputs in a new empty txt? I was thinking on using array b...
[3 replies] Last: Use a vector containing structs? struct scores { string name; ... (by Lynx876)
Help me understand this
 
Hi, I have been reading this: https://www.cs.bu.edu/teaching/cpp/inheritance/intro/ and they have an example like this: class Employee { public: Emp...
[6 replies] Last: @clanmjc Ah, I see. Excellent, thanks for clarifying. (by MrHutch)
by lql44
function returning array
 
Hi All i am trying to write the following function returning a array,but error saying "OutputArray" has unknown size. any advices? double* MyFunction(dou...
[6 replies] Last: I knew that, but I forgot. As I said, I am new to all this :) No wo... (by MrHutch)
is it possible to rotate an array more than one position?
 
Here is the part of code I wrote but this moves the array only one position to the right...----------------------------------------------------------------- ...
[2 replies] Last: Moschops, works perfectly! Thanks so much. I believe I was missing one... (by cpplover)
by lql44
isnan in C++
 
Hi All, I am tryign convert some java code to C++. Not sure is there is a isnan method in C++. Any advices? #include <iostream> #include <math.h> v...
[1 reply] : Ensure you're not dividing by zero. Otherwise, you're into the realms... (by Moschops)
February 2012 Pages: 1... 4748495051... 64
  Archived months: [jan2012] [mar2012]

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