Yes I am programming in Windows 10 using Dev-C++
Type: Posts; User: underpressure
Yes I am programming in Windows 10 using Dev-C++
Makes sense. I guess for it is hard to debug my program when I can't think of potential errors. I am assuming there are no blank lines because looking at my text file there simply isn't any.
I...
This is my train of thought
while (getline(inFile,text))
Tells me that as long as the program can read a line of string it'll do the following
{
This is simply it
15802
Soooo I spoke too soon. For some reason I'm getting some weird output when I run my program. Mainly theres seems to be random duplicates appearing and I'm not too sure why.
My current code:
...
Thanks laserlight. Using a while loop for getline works much better and cleaner than the other approach I was using. It is a shame that I am being taught bad code in my C++ class when there is much...
Hi laserlight; unfortunately I am not allowed to make the book struct into a class. I have to have it as a struct under the Collection class as per guidelines of my assignment.
I'm not sure what...
Hello,
I'm currently working on a program where I have a file I retrieve data from, and sort the different options (title, author, genre) and display the sorted list for each option. I have to...
Never mind. I have figured it out
Is there no way to use maybe a for condition in the main when I am asking it to cout << uni[loc] << yearlytuit[loc] ?
hello!
I am writing a program to find the minimum value in an array that is within an int function. There are two elements in the array that have the same value and I need to be able to output...
Excellet advice again. I totally get it now. Thank you for the help!
Thank you laserlight. Simple tip for me to figure out but such an obvious mistake I discovered in my code... it works now excellently. One last question; I initialized my flag variable to be equal to...
Thanks for catching that. Should've been using the equality operator. And I will rename flag in my final iteration of program as soon as I get it to work, just a name holder for now. Program still...
That doesn't do anything as I still get the same result
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;
//function prototype
Thank you. Makes sense to make it more efficient rather than separate.
Do you have any idea on how to make my min code work? I declared min = 100 since I know that there are values lower than 100...
I got it for the max option.. I'm not sure how to do it for the min option?
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
Thank you for the input all.
Unfortunately I have not learned limits yet in my class so I am unable to utilize them.
I think I can still take the advice given by Niccolo and cooper by...
I'm currently learning about fstream in my beginner C++ class. I have an assignment where I am asked to do various things. I have a file that I read the name of the cities and their affiliated cost...
Thanks for the response -
I am trying make a condition where if the totalcost variable is less or more than the minimum total for each different case ('X', 'S', 'L').
So I assume I would have...
Nevermind; I realized I didn't add my variables to the prototype in line 6 as well as the calculation in main in line 38.
A follow up questions; it doesn't seem to be calculating my totalcost...
Hi all,
I'm taking an introduction to C++ right now and I've been scratching my head over these errors. I'm not sure why my function is not being defined?
The errors are: undefined reference to...