Beginners - March 2013 (Page 85)

fstream problem, please help.
 
srand((unsigned)time(0)); int random=rand() % 3 + 1; SetConsoleTitle("PotatoOS v1.1"); string input; string output; bool word(ch...
[1 reply] : try replace readFile<< ""<<input<<""; with readFile<< input<< '\... (by y2krush)
adding while loops
 
adding while loops how do i fix my code? now i am trying to add a while loop so the program will only exit if you put 0 or a lower number. ...
[1 reply] : I would use a do while for this. while (salary <= 0; salary++) /... (by atriumheart)
how do i fix my code
 
how do i fix my code? now i am trying to add a while loop so the program will only exit if you put 0 or a lower number. #include <iostream> #include <math...
[7 replies] Last: while(num > 0) { ... ... } (by atriumheart)
Exponents
 
Is there a way to output an exponent in c++? I want to show an output of meters cubed. Any help would be great.
[1 reply] : this is a cheap way of making things cubed easily #define cube(a) (a*... (by Spikerocks101)
by Ratzer
Enter and ESC keys
 
Ok, so what I am trying to do works fine but I can't capture the Enter key and the ESC key. What I have is a menu state and a game state. What I want to happ...
[1 reply] : What about replacing the 'CR' and 'ESC'? IsKeyDown(ENTER) IsKeyDown(ES... (by y2krush)
Creating several variables in a while loop?
 
Background: Assignment for my class, create a program that checks the letters of a entered string. int main() { const string key = "abcabcabcabcabcabcab"; ...
[2 replies] Last: I misread the instruction! I managed to figure out a way to do it. Now... (by McFads1)
Dynamic memory question
 
Hey. I'm trying to write a program, which is supposed to hold pointers to variables. Now, it should hold an undetermined amount of pointers. I could declare a h...
[1 reply] : You can not grow an array. You have to create a new one with the desir... (by toum)
How To Pass A Two Dimensional Array To A Function.
 
For my C++ class I have to write grade book program using a two dimensional array. The grade book will be 5 rows, and 7 columns. In the below code I am trying t...
[2 replies] Last: AHHHHHHHHHHHHHHHHHH. Thank you!!!! Stupid typos! (by Baumer8993)
BASIC question about classes
 
What's the error in the follwoing program? #include <iostream> using namespace std; class a{ public: void set(int x){num = x;} int get(){return n...
[2 replies] Last: Thanks, can you tell me when to put ; at the end of line 6 and 7? (by Rehan FASTian)
Why do I have an infinite loop?
 
As you can probably tell, programming is not my thing, but unfortunately this class is required. I seem to have myself an infinite while loop, but I can't figur...
[1 reply] : I'm gonna attempt to help you. The "reason" that you have an infinite ... (by atriumheart)
by Handar
Custom strcat function using pointers
 
Hello, and thank you for taking your time to read my post. I'm an Icelandic IT student, currently learning C++ programming, amongst other things, and this week...
[2 replies] Last: You're absolutely right, thanks a lot for your help. :) (by Handar)
For Loop not allowing inputs after first loop??
 
Hi everyone, I'm very new to programing. I'm trying to create a program that will allocate the cost of an environmental clean up over a number of insurance...
[4 replies] Last: Yes, sorry about that... I'll post up my code when I get home. Thank... (by kevinbright)
Phonecall cost calculator with functions, call by reference
 
Been staring at this code for quite some time. this program is supposed to calculate the cost of a phonecall depending on day, start time, and length. No...
[1 reply] : line 46 you've switched callcost and totalcost. (by toum)
Default Constructors
 
We cannot use constructors if we want that whenever a pointer is declared, it should be NULL. Am I right Sir? if I declare student *head, *tail, where student ...
[1 reply] : Which default constructor are you talking about ? The one of your stud... (by toum)
compare array
 
I
[4 replies] Last: Meaning he used your code for his homework lol. Also please don't dele... (by closed account 3qX21hU5)
Modifying VB.NET NumericKeyPress event code to C++
 
I asked this stackowerflow before but there were no reply. http://stackoverflow.com/questions/15159576/modifying-vb-net-numerickeypress-event-code-to-c Can s...
[1 reply] : I added this->textBox1->KeyPress += gcnew System::Windows::Forms::Ke... (by Flashbond)
Backspace behavior
 
With TextBox1 If .SelStart Then .SelStart = .SelStart - 1 .SelLength = 1 .SelText = "" End If .SetFocus End With I used to use this code in ...
[no replies]
My object array doesn't draw to the screen
 
Hey guys, I've run into another error in my code. I'm basically defining classes 'Cube' and 'Enemy', passing them coordinates, then drawing them. Works fine wi...
[9 replies] Last: Your last post is a good way to solve your problem, although be sure t... (by Branflakes91093)
Performing equations using an Input.txt file
 
Hi, I am looking for a hint in the right direction regarding my program. I don't just want the answer because I want to be able to understand it. The part in b...
[5 replies] Last: That's embarrassing I got it now haha! And I changed my numbers to flo... (by nfordhk)
My Tic-Tac-Toe game isn't working properly.
 
So I've made a Tic-Tac-Toe game, but when a player wins it doesn't do anything. Also when there is a character in all of the squares ,so it is a tie, instead of...
[no replies]
March 2013 Pages: 1... 8384858687
  Archived months: [feb2013] [apr2013]

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