Beginners - July 2011 (Page 12)

Keeping a program running
 
I was wondering if there is anyway to keep a console program running even after you close it. Basically I want to make a phonebook and I dont want the phonebook...
[2 replies] Last: Yeah, I will go that route then and input the contacts in the console ... (by Maese909)
What's wrong with this code?
 
This is really getting annoying. But basically I'm trying to write a program that whenever a person presses a key on a keyboard the console window will cout "Lo...
[2 replies] Last: Hi thanks for responding, oddly enough, that works. (by creekist)
Determining the Length of Linked List
 
I have a linked list in a template class. My function is trying to determine the length of this list, but it gets stuck in an infinite loop. I know that it tr...
[6 replies] Last: I should have seen that one myself. Thanks again! (by joatmon)
Help with Encryption and Decryption
 
Hi all. Was trying to put together a code in response to this project: Write a CPP program that will print a menu of 3 choices: 1 for ENCRYPTION 2 for D...
[1 reply] : This may be better to see after a few changes #include <iostream> #in... (by Chicagoguy)
by Wirsbo
cout << armor []?
 
Hey. How would my code be if: I want all my "armor" variables to be in an own cout, like that if a new "armor" variable is created it will be printed? int...
[3 replies] Last: Ok, then. What you need is a for loop -> http://cplusplus.com/doc/tuto... (by m4ster r0shi)
"string" is undefined
 
hey does anyone knwo why do i get an Error: identifier "string" is undefined. when i use this code in a class header file... #pragma once #include <string> ...
[2 replies] Last: thanks you're right (by pcultras)
Assigning individual numbers from an array using rand() (i.e. no repeats)
 
Each time through my loop I want to assign number1, number2, number3 and number 4 a random number from the array numbers . However, I don't want to repeat any o...
[3 replies] Last: (1) Since indexes is an array, its name is a pointer to its first elem... (by m4ster r0shi)
Monthly payment calculator - could not get it to work
 
I wrote a program that asks the user to choose different packages for a car. It then calculates monthly payment. The choosing part (switch statement) works, b...
[2 replies] Last: principal=car_price-down_payment; car_price is not initialized.... (by Warnis)
tic-tac-toe
 
I'm in the initial stages of programming a tic-tac-toe game and for now I'm trying to get this bit of code to work: #include <iostream> #include <fstream> #in...
[3 replies] Last: I see what you mean now dangrr888 about not initializing. I don't know... (by bool maybe)
by wtf
Is this dangerous code?
 
#include <windows.h> using namespace std; class sneak { TCHAR EXE ; int size; string exe; public:sneak() ...
[7 replies] Last: like how? Whats the method that GoogleToolbarUser_32.exe uses? I keep... (by wtf)
Pong problem
 
Everything is working fine in the game exept one thing. After a new round if the user was holding down a button, he cant move in that direction. If he lets g...
[5 replies] Last: @disch i do zero the yVelocity. That doesnt fix it though. How do i c... (by nano511)
pointers
 
#include <iostream> using namespace std; double computeaverage (int ,int ); int main() { int *p; int n; cout<<"Enter number of data "; cin...
[3 replies] Last: cout<<"average"<<computeaverage(a,n)<<endl; This line. Where... (by Disch)
How to make Class A modify Class B member?
 
Im making a pong clone, and i cant figure out how to make changes in the Settings state change member variables in the Game state. Anyone have any ideas? If it ...
[6 replies] Last: Actually i dont think i can make it work. I just remembered when the s... (by nano511)
by wtf
2 questions. Is it possible to get name of the exe currently being run?
 
I'm writing a file shredder and want to make sure that the shredder doesn't try to accidently delete itself. I know I can always keep a const string in the fil...
[5 replies] Last: I did, and I was lead to the site you posted, which doesn't show any e... (by wtf)
by Savale
Returning a string from function
 
Hi guys, For a program I am writing I trying to return a string from a file, and I use that string in a different cpp file. The cpp code that read from the f...
[2 replies] Last: I tried doing what you said but it gives me an error on line 3 saying ... (by Savale)
Difference between
 
in the increment of a for loop, I don't know the difference between ++t and t++. Is there one?
[3 replies] Last: ++x == x = x + 1 x++ == tmp = x, x += 1, tmp x++ will creat... (by closed account DSLq5Di1)
by Lenton
How can I do this?
 
I have this code: #include <string> #include <iostream> string square1; void test(int number) { square+number = "lol"; } int main(int argc, ...
[3 replies] Last: A function should return void when it doesn't return anything, and sho... (by Disch)
Separate Program into Functions
 
I'd like to separate my program into different functions. The code literally explains itself inside the function fDisplayExplanation(). Here is the code with...
[2 replies] Last: Thanks alot, so far I've successfully used your function, and then put... (by BranKeye)
Program that identifies poker hand (e.g. flush, straight, straight flush, three of a kind, etc.)
 
So I'm writing a program that identifies a user's poker hand. I have three questions. First -- I do not think my function "check_cards" is working correctly....
[4 replies] Last: coder777, THANK YOU SO MUCH! My code works now. You are right about e... (by bool maybe)
by kip121
Help with this please
 
I am sure this is boring for those of you who kow what you are doing, but i am completely new to all of this and need a bit of guidance. Please be gentle. I ...
[2 replies] Last: Thank you for refering me to that post, but forgive me for sounding st... (by kip121)
July 2011 Pages: 1... 1011121314... 54
  Archived months: [jun2011] [aug2011]

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