49,756 Topics

Member Avatar for
Member Avatar for Jboy05

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 …

Member Avatar for superjacent
0
177
Member Avatar for CoolGamer48

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 …

Member Avatar for Ancient Dragon
0
284
Member Avatar for demroth

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 …

Member Avatar for demroth
0
153
Member Avatar for Nyx18

does anyone know a site or something that can actually show me the code for strcmp and/or strcat?

Member Avatar for sarehu
0
110
Member Avatar for Exo1337

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, …

Member Avatar for codeaa
0
268
Member Avatar for Jennifer84

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

Member Avatar for sohguanh
0
151
Member Avatar for IIMarckus

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) …

Member Avatar for vijayan121
0
105
Member Avatar for sohguanh

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 …

Member Avatar for sohguanh
0
131
Member Avatar for cwarren13

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 …

Member Avatar for cwarren13
0
88
Member Avatar for Phan

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 …

Member Avatar for Phan
0
113
Member Avatar for silentstryk07

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 …

Member Avatar for danzona
0
90
Member Avatar for yazooney

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 …

0
78
Member Avatar for boburob

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 …

Member Avatar for codeaa
0
769
Member Avatar for The Midnighter

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: …

Member Avatar for The Midnighter
0
182
Member Avatar for Mini12321

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 …

Member Avatar for Mini12321
0
111
Member Avatar for RockClimber

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) { …

Member Avatar for codeaa
0
97
Member Avatar for sfurlow2

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 …

Member Avatar for pmvignesh
0
167
Member Avatar for rezax123

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

Member Avatar for rezax123
0
128
Member Avatar for darktroyan

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 …

Member Avatar for ithelp
0
88
Member Avatar for sfurlow2

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 …

Member Avatar for sfurlow2
0
794
Member Avatar for DeepakHemnani

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 …

Member Avatar for sohguanh
0
116
Member Avatar for manzoor

[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 ?

Member Avatar for John A
0
65
Member Avatar for pottert

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 …

Member Avatar for Ancient Dragon
0
5K
Member Avatar for bleonard989

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> …

Member Avatar for Ancient Dragon
0
124
Member Avatar for Jboy05

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 …

Member Avatar for Ancient Dragon
0
110
Member Avatar for virus.exe

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?

Member Avatar for John A
0
64
Member Avatar for jrkeller27

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 …

Member Avatar for vijayan121
0
3K
Member Avatar for kirangurram

Hello... How can I check whether My computer is connected to the INternet or not using a C++ program.. :S

Member Avatar for John A
0
33
Member Avatar for ckins

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 …

Member Avatar for VernonDozier
0
330
Member Avatar for virtual008

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 …

Member Avatar for virtual008
0
211

The End.