Beginners - September 2011 (Page 20)

Help Please! Cos/Sin errors
 
So I am in a C++ programming class for the first time and the assignment is to make a partical motion simulation: A particular object moves according to specif...
[2 replies] Last: Thank you so much! I appreciate the quick answer! (by pbdemon101)
Algorithm to calculate new date
 
I was wondering if anyone knows how to calculate a new date by adding a fixed amount of days to the current date. The class I am working on is called dateTyp...
[1 reply] : It looks like your "getDaysPassed()" function gets the so-called "juli... (by Duthomhas)
digit extraction (1,2)
 
I keep getting an error message, error C2143: syntax error : missing ';' before '<<' Can someone look at my coding and tell me what is wrong. // Exercise...
[21 replies] Last: ok this is what I did cout <<"Encrypted digit:" << digit_three << ... (by maria536)
by lirik
Perimeter and area of an abstract shape
 
Hi guys, so this is actually my first program in my C++ course. The main goal of this program is to find the area and perimeter of this shape: http://img829.im...
[5 replies] Last: I just realized I did the power's wrong :-) (by lirik)
by Zephni
RegisterRawInputDevices() undefined
 
Hi guys, very new to C++, But my job is calling me to make a program that reads from a HID device other than the keyboard. Someone has pointed me at using the ...
[3 replies] Last: Hi. No, sorry. I have never used the function before, nor do I have ... (by webJose)
How can I return a constant char within class?
 
I've made an char object variable called 'blockname'. I would like to call 'getblockname()' and return its value but there is complications with it being a cons...
[4 replies] Last: Worked. Thank you. :) (by carebearboy)
by erikn
pointer assignment- when to use '&'
 
this is valid in the book i'm reading: int *p,num; p = &num so is this: int *i, j ; double *f, g ; i=j; f=g; both accomplish basically the same thing right ...
[19 replies] Last: ok cool. my world is spinning a little less now, thanks. :) (by erikn)
if else
 
#include <iostream> #include <cstdlib> #include <ctime> #include <string> using namespace std; int main () { int max, black; string death...
[2 replies] Last: lol wow, thanx dude. (by SilverLake)
TicTacToe game help [Still need help]
 
Hi, I'm making a tictactoe game, and i created a player class with a function "PlayersTurn", the problem is I need to call some functions in the tictactoe class...
[2 replies] Last: TicTacToe.h #ifndef TICTACTOE_H #define TICTACTOE_H class TicTacTo... (by Jesus805)
Instructor requests inappropriate switch statement application>?
 
Okay so he wants me to rewrite this code: int score; cout << "Enter your score: "; cin >> score; if(score >= 60 && score < 70) cout << "D" << endl; ...
[7 replies] Last: For menus, use polymorphy. Unless it's really simple test code or just... (by hanst99)
A Quick Question Regarding '+' Prefix
 
I've ran into this today: ( 40 + +2 ) . Does the +2 denote a positive integer just as -2 denotes a negative integer? Wazzak ...
[5 replies] Last: I suppose you could overload it with something so it does something us... (by hanst99)
incuded files
 
lets you have main, and then 2 header files, 1 and 2. header file 1 has already included header file 2. in main, you include header 1. Is is ok to just incl...
[6 replies] Last: For starters, the standard header is <iostream> , not <iostream.h> .... (by Disch)
help plz......
 
plz help me to solve this problem... create a c++ program using while and for loop that will output: x is not between 1 and 4 x is one x is two x is three ...
[9 replies] Last: Think of the structure of your program first. while program is runn... (by Zephni)
by DouDou
Weird Stuff with a if statement
 
Either i am seing things but i dont understand why a condtional statement is satisfied upon exection of the code, while in reality it is not. double myVa...
[6 replies] Last: Are you sure you didn't just accidentally write <=? @Ben - his debugg... (by hanst99)
by Ron N
Explanation of Article on Scanf ()
 
The C++ reference article has this passage in it: Non-whitespace character, except percentage signs (%): Any character that is not either a whitespace charac...
[1 reply] : I don't use C functions myself, but it appears that with a file like t... (by hanst99)
by jalfor
Multiplication Interpreted as Pointer
 
Not much to say really...this isn't working and I don't have a clue how to fix it without putting them all in separate statements which I assume you wouldn't ha...
[5 replies] Last: When you compile the preprocessor replaces PI in the code with 3.1415... (by closed account 1vRz3TCk)
Input Multi-word "Strings"
 
Hi! I'm pretty new to programming. I'm learning to use classes. My class has a private array of structures which includes character arrays. Part of my a...
[5 replies] Last: The ignore would go immediately before getline. Its purpose is to remo... (by hamsterman)
by dznguy
do while loop skipping a step
 
in my do while loop, i have the user enter a response with y or n to continue or end the program. during the loop, if i enter y or Y, it would skip asking the f...
[4 replies] Last: since this is a hw assignment which i wrote from scratch and if anyone... (by dznguy)
dateType class
 
Hello all. I am writing the definition of a class called dateType that stores, well, a date. The member variables of this class hold the month, day, and year wh...
[1 reply] : The math is often done by converting to (then add days) and from Julia... (by coder777)
Breaking out of Nested Loops
 
Coming from a variant of BASIC, C++ seems to do a lot of things the hard way. I understand some of it is to squeeze every ounce of performance out of the code t...
[9 replies] Last: Read this: http://www.cplusplus.com/forum/articles/17108/ (by Nisheeth)
September 2011 Pages: 1... 1819202122... 48
  Archived months: [aug2011] [oct2011]

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