Beginners - May 2013 (Page 53)

Reading from a text file into Parallel Arrays
 
Having trouble reading information from a text file to parallel arrays. The info is arranged as such in the file: Name Street Address City, State, Zip Order ...
[1 reply] : Actually got this figured out on Stack. The solution is to use getline... (by GranTurismo)
Using parallel arrays and functions to get input
 
Hi all, I need to use functions in my main() and three parallel arrays. The first array needs to store the amounts from the file "sales.dat", there are 12 ...
[no replies]
While Loop not workig?!?!
 
Hi I have the following loop: while(s!=-1){ cin>>s>>p>>m; a[s-1][p-1]=m; } and when I input -1 for "s", the program wont exit the loop ...
[2 replies] Last: are you asking the user for 's' outside of the loop, because it looks ... (by palauan73)
Avoiding goto (1,2)
 
I've set a tiny program that reads your name and then checks with you if it's right, but I either repeat some code, or I use goto and I can't find a good way ...
[32 replies] Last: I updated the code above with the best I could come up with. I couldn'... (by Vidminas)
by gmby99
Dynamic Arrays
 
Hey guys, Need some much appreciated help. Can't get my program to run, Essentially, im trying to create a program that can open a read a file (txt) w...
[14 replies] Last: Check values on your first pass : ifstream fin("EGR126_data4.txt"); i... (by MiiNiPaa)
Using variables outside the function it was declared in?
 
Basically I have this variable declared in a function that I want to work with in my "main" function. How do I do this the best way possible?
[4 replies] Last: I want to use it in an if statement in main Just put return x; in... (by Chervil)
English Help
 
Hello, I'm working on an English assignment where I have to make a really one sentence. I have 2 text files 1 holding nouns, and the other holding prepositions...
[no replies]
Convert.To function?
 
Hi. I would like to know a simple way of converting string to int and int to string and so on. In C# I just had to type Convert.ToInt16() . Super simple. Is th...
[2 replies] Last: also there is stoi() (stod(), stold()...) function defined in <string>... (by MiiNiPaa)
by search
Which was the first
 
Hi guys. I have a simple question :D. If you need a compiler to run your code, then how was the first compiler made? Which was first the hen or the egg (The fir...
[3 replies] Last: The very first programs would be written in machine code and entered v... (by Chervil)
Array Help
 
Hey so I am in a class where we are using Microsoft C++ and right now we are working on a program using arrays. We are given a problem where we have to sort peo...
[3 replies] Last: I used all of these suggestions but i am still having problems. When t... (by beginnerstudent)
Need help reading in multiple strings from file
 
I have a class composed of three string type data members. I need two functions that will read and write that data directly from that class to file. The output ...
[1 reply] : Nevermind. I was passing by a constant reference in my '>>' function. ... (by sirjames2004)
Switching to C++ from Java
 
Do any of you know of any good online resources for making the switch from java to C++? I have taken a few years of object oriented in Java and I've been aske...
[4 replies] Last: you should try reading Let Us C by Yashwant Kanetkar (by PalashBansal96)
by Snaksa
Reversing Linked List
 
Hi everybody. I'm trying to reverse Linked List but I face some difficulties. I'm using two lists. The first one is the one that I want to reverse. The second l...
[9 replies] Last: #Solved (by Snaksa)
Issue declaring paper1
 
I need to design a class named TermPaper that holds an author's name, the subject of the paper, and an assigned letter grade. I am stuck on how to define and se...
[7 replies] Last: Thank you for the help. Still have some errors but I will figure it ou... (by zigfl03)
by timney
A strange thing about for-loop
 
Hi, everyone,I have a question about for-loop .Here is simplified question. Output result for clip1 is 0.9 ,and for clip2 is 0.7 ? Does it means 0.8<0.8 but...
[6 replies] Last: If you were testing for two floating-point numbers being equal, then r... (by Chervil)
Palindrome Code
 
I'm trying to make a code that prints out if the word is a palindrome or not. but the code always tells me that the word is not a palindrom when i input a pali...
[13 replies] Last: @Zereo Just making sure I understand it correctly, you are using std:... (by vlad from moscow)
New C++ Book.
 
Hello, I've been looking a bit through a couple of books, my recently book was Accelerated C++, but I stopped after 2 chapters. I don't know why, but I just ...
[4 replies] Last: Typically, I say learn the syntax of the language using any beginner C... (by moorecm)
Issue with header file.
 
Having a problem setting my declarations for paper1. This class has been fairly easy to this point. I am not sure if I missed a chapter but I am at a loss. No m...
[4 replies] Last: If you have having a problem similar zigfl03 post a new topic with you... (by closed account 3qX21hU5)
Division by a square
 
Hello, In the following function (in the class Option_Price_Family), I compute several quantities which are all of type double. At the end, I divide the doub...
[no replies]
help in a 1v1 battle sim
 
I'm trying to make a 1v1 battle sim which will make random values and generate a random health for my opponent. This should run the attacks in turns till someon...
[1 reply] : Solved it myself! If anyone else is having a similar problem use a for... (by ixtowelie)
May 2013 Pages: 1... 5152535455... 66
  Archived months: [apr2013] [jun2013]

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