Beginners - June 2013 (Page 27)

by piczim
1 question 3 possible answers how do I goto a routine based on the answer
 
I have a question which has three possible answers. How do I write code that takes the answer to the question and then takes it to another piece of code whic...
[12 replies] Last: > I thought I was learning c++ but the above code looks like nothing I... (by JLBorges)
Array length specifications?
 
Hi all, I am new to C++ and I have a doubt. int x = 2; int a ; For the above code , VC++ 2010 shows the error. Intellisense: expression mu...
[11 replies] Last: Glad it was working. I'll consider your request - and thanks for the v... (by Chervil)
Stl queue or multiset?
 
Hello there, I am doing homework assignmet on STL, and I have a question. One of the function need to take two different arguments and create a data structure, ...
[3 replies] Last: std::vector Store elements in given order and tightly packed in memo... (by Catfish4)
catch input errors
 
My very simple program is to register hotel guests. At the beginning, the user should input 1, 2, 3 or 4 to go to the next step. What is the best way to cat...
[1 reply] : #include <iostream> using namespace std; int main(){ int input = 0... (by Himansh)
vector erase
 
what will this code do? #include<iostream> #include<string> #include<vector> int main() { vector<string> object; for(int count=0;true;c...
[2 replies] Last: This code tries to abort the program.:) (by vlad from moscow)
[Win32API] Multithreading problem
 
so I want to create 2 threads that will do something, but both of them will start with different starting number, however they will BOTH will get the same numbe...
[14 replies] Last: thanks! useful as always :) (by mekkatorqu)
by Blank
change for a dollar game
 
i need help. is my code correct? and is there anything i can do to improve it? float pennies, nickels, dimes, quarters; float total,sum; cout << "...
[1 reply] : Use int for variable type, You cant have half a penny etc... (by Pebble)
using unique on a vectored structure
 
I am trying to remove duplicates from a vectored structure. I cannot figure it out. My structure contains only two ints. my code is below. Can someone help....
[1 reply] : std::unique() removes duplicate elements which are next to each oth... (by JLBorges)
create a wav file using visual studio 2012
 
I have down loaded Visual Studio 2012 C++ and have it working using Windows 7 – I’ve successfully run the standard ‘Hello world’ program – wow! I n...
[no replies]
by Ch1156
Delaying program without using sleep
 
Ok so im trying to make a timer that i will start counting when then program starts, its use is to tell the player how long they played the game for. I dont wan...
[3 replies] Last: I know but i want to make my own timer. (by Ch1156)
File System Simulation
 
Hi all, I have been having issues with creating a file system simulation that consists of a class Sdrive and a class Filesys. The Sdrive basically simulates t...
[no replies]
by esazs
my morse code translator
 
my code works for the most part, but im trying to allow whole words. i am a somewhat beginner at coding, please help and explain in very simple terms how to all...
[2 replies] Last: @nkendra If your planning to call TranslateToMorse() from you loop, t... (by andywestken)
by deevan
calling a method without instantiating a class
 
Hello I have a C++ Abstract class (NClass) of which a method f1 is being directly called. f1 is allocating memory (and its causing a memory leak). Here's ...
[4 replies] Last: OK, thanks so much - its a bit convulated bit ultimately there is a ne... (by deevan)
Why do I get exc_bad_access after multiple runs?
 
I am an amateur programmer and I am programming as a hobby only. I am using an older system (OS X 10.5) with XCode 3.1.2 and writing in C++. I am writing ...
[2 replies] Last: Some code would be helpful. Particularly around where this is crashin... (by nkendra)
Just finished reading up to Classes(II)
 
I wanted to post my practice CPP file and make sure I am doing everything properly. Everything does compile and execute as designed, however, what im looking fo...
[7 replies] Last: I know!!! I just read through friendship and inheritance, polymorphism... (by closed account NyhkoG1T)
by AisuX
No match for operator!
 
When I compile, it shows no match for operator!. cout<<"Would you like to skip file work? (Yes / No)"<<endl<<endl; cin>>lol; do{ if(lol=="...
[5 replies] Last: On line 5, you are constructing an ifstream object that is attemptin... (by nkendra)
by rjizzo
Inheritance exercise
 
Write your question here. #include<fstream> #include <iostream> #include<iomanip> using namespace std; class payroll{ public: void setVariables(int...
[1 reply] : employee ->setVariables(empID,fName,lName,stat,hrs,rate); employee ->... (by ne555)
Static Arrays
 
Hello. I want a class to store some arrays, I don't want to (or need to) instantiate this class, since its arrays will be unique. So I guess I can create them ...
[2 replies] Last: I didnt use namespace, but i solved my problem, thanks anyways! (by PauloF91)
by Andym
Trouble with my looping
 
OK, so im making some progress here!!! My assignment is to open and read from a txt file ("GradeFile.txt") with 3 rows of data. Each row of data represents a ...
[9 replies] Last: I took the time to re-write the idea for this program for my own pract... (by closed account NyhkoG1T)
Function is not returning the correct number
 
I've written a simple code to covert Fahrenheit to Celsius, however no matter what input you put in, you ALWAYS get an output of 0 #include <iostream> u...
[3 replies] Last: Yup that worked. Thanks. stupid integer division. (by Mobius1)
June 2013 Pages: 1... 2526272829... 49
  Archived months: [may2013] [jul2013]

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