49,756 Topics
![]() | |
I have to write a C++ function named MPG which returns the number of miles a car can travel with one gallon of gasoline. The function should have three parameters: the size of gas tank in gallons, number of miles traveled, and gasoline left in tank in gallons. this is … | |
Is there any reason why the code below won't work (I mean as far as writing output to file, not as far as writing the correct output to the file): [CODE] #include <cstdio> #include <iostream> #include <fstream> using namespace std; int main() { ofstream fout ("ride.out"); ifstream fin ("ride.in"); char … | |
This is the first program I have had to do in 5 years so please don't be surprised by some of the mistakes. I am creating a program that will open a file and sort the integers inside that file using Insertion sort. There are 12 files and each as … | |
does anyone know a site or something that can actually show me the code for strcmp and/or strcat? | |
Ok so I need to pull up records one at a time and then have the loop terminate when it reches the end of the input file using while and the istreamVar.eof() commands [code=cplusplus] #include <iostream> #include <fstream> #include <iomanip> using namespace std; int main() { ifstream ticketSale; int num2, … | |
I wonder what the correct syntax is to delete All contents like below: [B]2D vector string vector double vector[/B] These 3 look like this: [code] std::vector<std::vector<string> > Word2(100, std::vector<string>(100)); std::vector<string> Word1(100); std::vector<double> Number1(100); [/code] Is it correct to do this: delete[] Word2; delete[] Word1; delete[] Number1; Thank you | |
Hey guys, I've been having some trouble setting ios:: flags. In general I don't use [inlinecode]using[/inlinecode], but without it what I do doesn't work. [code]#include <iostream> #include <iomanip> using namespace std; int main() { double moneys = 5.2; cout << "$" << moneys << "\n" << "$"; cout << setiosflags(ios::fixed) … | |
Hi everyone, I am new to this online forum. I am a software engineer residing in Singapore doing software development for a living for past 9 years. Only recently am I introduced to the wonders of ACE. It is such a pity the ACE framework is not part of the … | |
Note: second post contains more info about where I'm having a problem... what I'm expecting to do and what the program is actually doing. Hey all, I'm finishing up an assignment for my C++ class and I can't figure out why the program stops in the middle of it. The … | |
I am a noob that is currently trying to learn C++ for a programming class in highschool, and I am having difficulty with a particular project. Basically, I have to create a number guessing game that lets the user play as many time as he or she wants, while telling … | |
Ok, basically where i'm hitting a stumbling block here is that i need to be able to create an array of this sort: [U] SAMPLE INPUT FILE (Use EOF to terminate)[/U] 1121 15.12 40 9876 9.50 47 3333 22.00 35 2121 5.45 43 9999 10.00 25 those three columns are … | |
Hi, Currently trying to ./configure;make;make install a program called gmsh. I installed gsl through cygwin. However, everytime i try and ./configure the program gmsh, i get: [CODE]****************************************************************** This is the free version of Gmsh and configure could not find the GNU Scientific Library (GSL) on your system: - if it … | |
Hi, I am designing a code breaker program that works out letter frequency in a text file and tries to codebreak using the frequency that letters appear in the english alphabet, however at the moment it is only outputting whatever is at the end of the decry array. Thank you … | |
Alright, so I've got a Merge Sort program working that accepts a text file, and is supposed to split the data from that one text file, into TWO different text files. This is however, just putting them into one =x Any idea as to why? here's part of my code: … | |
Ok, so Im gunna make an Embeded Browser Based Application Framework Development, you know, kinda like java or flash. How would I go about this? Links? Tutorials? Anything? And dont just say "if yo dont know how this works you shouldnt be trying it.", because if noone teaches me how … | |
I'm teaching myself C++ through googling (my class has no textbook, if you can believe it) so I apologize in advance for my (probably) incorrect terminology. I want to name individual incarnations of a struct by numeric information supplied by the user. Here is a snippet: [code]int main (void) { … | |
Here's the problem: Ask the user for a floating point number until the user enters a negative number or zero. After each number the user enters print the highest and lowest number so far, and the average so far. Do not print the highest, lowest, and average when the user … | |
i wanna make a .com file. i mean command.com file. i m using visual C++ 6.0. i know the way to make the EXE files but dont know how could i make a COM file | |
Hey, my name is Alberto i am just starting to lear all about programming with C++ and one of my assignments is to open a file data1.txt into the program using ifstream inData where inData is the name of the variable for my file. the problem i have found is … | |
I have another question for my homework. Here is the problem: Keep inputting numbers from the user until the user enters a 0. After each number, print a "running average". That is, print the average of the last three numbers entered. Be careful how you handle the first two numbers … | |
Can anyone please explain to me the detials of what the fork command does?? Like wat is the Pid of the parent for a child created using this command.. again also it is said that it creates a replica of the currently running process what does this exactly mean?? Do … | |
[CODE]frequency[ grades[ 2 ] / 10 ]++; [/CODE] here assume that grades[2] includes 87, divided by 10 it equals to 8.7, which equals to[CODE] frequency[8.7]++;[/CODE] so is the decimal removed ? or is it rounded to 9 ? | |
hey everybody, I'm in an Intro to Programming with C++ class and I need help with an assignment. Is there any way to declare variables or arrays in Hexadecimal? If so, how should I do this? If this isn't possible, is there any way for me to indicate to the … | |
This might be really simple or impossible, but what I need to do is somehow take what the user inputs in the client code, and set one of my variables in my constructor to the variable in the client code. This is my client code [code=language] int main() { StackType<int> … | |
I have to wrtie a valid C++ condition (Boolean expression) for each of the following checks: (naming my own variable when needed) [code] if the value of the variable GPA is between 3.0 and 3.6 excluding 3.0 and 3.6. if a voter is at least 18 years old and had … | |
Is there anyway to just download a web page in c++? I need a program that can download a webpage at certian times of the day to get updated information. Is this possible? and if so how? | |
In C++ is there a way to define a class to be "comparable"? What Im trying to do is write a class that holds a string and a vector of numbers. If an object of this type is compared to another object I want the string that each object contains … | |
Hello... How can I check whether My computer is connected to the INternet or not using a C++ program.. :S | |
I can make a box with a char quite easily where the user enters two values L, and W using a for loop but I don't know how to make just the outline. I'm told there are 2 if else statements needed and I've nested my for loop. I don't … | |
Hello I'm trying to make a simple function to Rot13 strings and it's not working.I ran it through my debugger and it works until it get to the top of the loop again???Then some of the chars are rot13ed and some stay the same. [code=c++] void Rot13(std::string &buffer) { int … |
The End.