49,766 Topics

Member Avatar for
Member Avatar for jimps

Hey, I'm not sure how to do this. I know how to convert a char into an int, getting the ascii value, or the numeric value, but that's not what I want to do. Basically I have a CHAR, I give it a value, usually a short sentence, then I …

Member Avatar for atish00
0
84
Member Avatar for deactivated

Hey everyone Maybe someone can help me with this. We are supposed to create a program that will read a .dat file and then output a new file containing the total number of rows in the data file, the sum of integers and the number of occurrences of the number …

Member Avatar for plgriffith
0
88
Member Avatar for johnqsmith

Problem background: gcc v 4.1 2 .cpp files, 2 .h files Files: main.cpp a.cpp a.h b.h Organization: main.cpp includes a.h (because it calls a.cpp code) a.cpp includes a.h a.h includes b.h (because a class in a.h uses a b.h class) There is no inheritance between a.h or b.h or any …

Member Avatar for Ancient Dragon
0
188
Member Avatar for Run.[it]

In class weve been shown how to read from a binary file and read from a text file but Im unsure how to write text to a binary file? Heres my attempt so far, Can you help? [CODE] #include <iostream> #include <stdio.h> using namespace std; int main() { FILE *namefile …

Member Avatar for Run.[it]
0
206
Member Avatar for s_mostafa_h

hi All can anybody introduce a good cds Training C++ . CDS Training sometimes can be good for taking some tips... rgds

0
59
Member Avatar for clavezza

Hello Group Nice to meet everyone. First time posting to forum. I hope to have better luck then I did on Sourceforge.net forum. I am using DevC++ version 4.9.9.1. I am getting this error message in my compile log and I do not know how to fix this problem. Here …

Member Avatar for HOLYANDHOLY
0
241
Member Avatar for abar

I want to override the normal keypress event Alt+F4 in my application. I am using borland builder 6. i wrote a fn for Application->OnMessage = msghandler; In this handler I am checking for the Key State of the Alt & F4 & then if the key is pressed I am …

Member Avatar for abar
0
240
Member Avatar for fiz hafiz

[CODE]#include<stdio.h> #define FILENAME1 "all.txt" #define FILENAME2 "even.txt" #define FILENAME3 "odd.txt" int main() { int i=0; FILE *all; all = fopen(FILENAME1, "r"); while(fscanf(all,"%d")!=EOF) { printf("\n%d",i); i++; } FILE *even; even = fopen(FILENAME2, "w"); FILE *odd; odd = fopen(FILENAME3, "w"); for(i=0;i<=10;i++) { if(i%2==1) fprintf(odd,"%d",i); else fprintf(even, "%d",i); } return 0; }[/CODE]

Member Avatar for mitrmkar
0
52
Member Avatar for blcase

ok exploring the STL <set> if you entered the values say 1 to 1000 in order would it auto balance?....i thought no but then a friend of mine told me about this "red and black" tree and if i test the result times to find an element (random and numeric …

Member Avatar for vijayan121
0
79
Member Avatar for knight fyre

I'm trying to design my UML diagram but I'm not sure about something. If I have a derived class that belongs to two other classes will the two other classes inherit the features of the base class? For example class Vehicle_Details inherits features from class People[I](is-a relationship AKA inheritance)[/I] while …

Member Avatar for knight fyre
0
89
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
180
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
288
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
158
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
273
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
108
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
134
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
90
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
118
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
79
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
793
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
189
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
112
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
100
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
168
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
130
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
92
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
804

The End.