49,757 Topics

Member Avatar for
Member Avatar for EOTF

Hi folks, I'm having problems with my loops, and possibly more...hehe! I'm loading a text file, which has 1 word per line, into a buffer and I want to search the buffer for all the words that start with the same prefix (3 letters) and return the words in an …

Member Avatar for Ancient Dragon
0
97
Member Avatar for DemonSpeeding

I have a question about adding say integers to an array-based list of numbers. I know how to add something at the end it would be something like: values[count] = newValue; count ++; What about if someone wanted to add something to the beginning or somewhere between? My book doesn't …

Member Avatar for Ancient Dragon
0
100
Member Avatar for jacksonwee

im new to C++ and i got an assignment which required me to do a hangman game. Global variables are not allowed. program must be modular, i.e create suitable functions. for functions, i was told to use reference parameters instead of pointer parameters. i am to use string class and …

Member Avatar for WaltP
0
86
Member Avatar for Underdog67

Here's my code: [CODE=language]include <iostream> #include <iomanip> #include <fstream> using namespace std; int main(){ int ID; double largest; double secondLargest; double sales; int largestCount = 0; int secondLargestCount = 0; ifstream infile ("sales3.txt"); if (!infile){ cout << "Error: cannot find input data!\n"; return 1; } cout << " Acme Sales …

Member Avatar for vijayan121
0
79
Member Avatar for sylvaticus

Hello.. is it possible to append some data on a text output file appending the data to each row, and without use too much computational I/O ?? Instead of the classical way: [code] VARX VARY VARZ... year1 x1 y1 z1 year2 x2 y2 z2 [/code] .. I would like to …

Member Avatar for Narue
0
107
Member Avatar for dukedoc

I have this program for computing an individual's cable bill, then summing each column of values and calculating the average of each column. I got a 100 on the assignment, the program works fine, but this time we have to use functions. I created my functions and the program, again, …

Member Avatar for WaltP
0
340
Member Avatar for k7_keshav

can some one help with how to use mouse in c++ can someone help me with how to use click option

Member Avatar for GreenDay2001
0
92
Member Avatar for tnvkrishna

hello, i wrote a header file the file got deleted while i was compiling it that header file includes a class definition and nothing else what might be the problem? tnvkrishna

Member Avatar for Salem
0
94
Member Avatar for sarahger9

Hi, I wrote a program that reads a file, by building up text one character at a time, looks for keywords, and replaces them if they are found. I am working on building up my output. The words come out right, and I added the punctuation back in ok. The …

Member Avatar for sarahger9
0
86
Member Avatar for koolboy

[code] #include <iostream> #include <string> using namespace std; float input_div(string); void findHighest(float, float, float, float); int main() { float nE, sE, nW, sW; nE = input_div( "North East" ); sE = input_div( "South East" ); nW = input_div( "North West" ); sW = input_div( "South West" ); findHighest(nE, sE, nW, …

Member Avatar for parthiban
0
99
Member Avatar for zandiago

[CODE] #include <iomanip> #include <cmath> #include <fstream> #include <string> #include<string> #include<iostream> #include<iomanip> using namespace std; int main() { ifstream infile; ofstream outfile; int num;//number of grades int Hi;//highest test grade int Low;//lowest test grade sting stat;//status of grade, whether higher or lower than avverage infile.open ("grades.txt"); outfile.open ("gradeOutput"); double number;//the …

Member Avatar for zandiago
0
535
Member Avatar for cowboys111

Im writing a program to calulate the distance between two points unsing structures and functions. I have everthing working perfectly except that I cant get it to repeat for a second set of points. My input file has 10 points in it bit it stops after it reads the first …

Member Avatar for cowboys111
0
106
Member Avatar for Meglor

If i type a simply code with an output of "hello world" on the screen, printf ... u know the code, the programm isn`t able to do the .exe programm. I don`t know why. GRrrr. If i try to write difficult programms, it is the same probleme with the exe …

Member Avatar for Ancient Dragon
0
91
Member Avatar for mirakl

hi, I am finishing up a program and in the program I need to add numbers after a certain number example for every ten numbers 30, 40, 50 i need to add .125 i have this so far if ( age > 30 % 10 == 0 ) // Formula …

0
50
Member Avatar for rogenie

This is a very simple app I am trying to do. How else would sum up the total of the number the user entered? Example if the user enters 10, the loop will find the sum of 1,2,3,4,5.....10. Here is my code and I spent few hours on to come …

Member Avatar for rogenie
0
110
Member Avatar for notathing

1) Class creation Create a class called Song. It will contain the following private attributes: The song title. The artist who performs the song The duration of the song in terms of seconds. A song that lasts 3 minutes and 30 seconds will hold a value of 210. Create a …

Member Avatar for twomers
0
85
Member Avatar for sean25hun

Can anyone help me with pascals triangle . I got it to do a factorial number , now it want to display the results in a pyramid. #include <iostream> using std::cout ; #include <iomanip> using std::setw ; long int factorial(const int); int main() { long int k = factorial (5) …

Member Avatar for Narue
0
188
Member Avatar for DemonFox

i have started my midterm exersize than is on binary treescan anyone help me on the basics i have started and i have made the following on my tree.h file: [code] struct treenode { int data; struct treenode *left; struct treenode *right; };typedef struct treenode *PTR; class tree { private: …

Member Avatar for eskelsen
0
112
Member Avatar for zandiago

Write a c++ program that will read in an unknown number of employee records from a text file call “PAYDATA3.TXT”. Each employees record is a string of 47 characters (with spaces), set up as follows: Positions Data Description 0 – 14 Last Name (15 characters) 15 -24 First name (10 …

Member Avatar for zandiago
0
160
Member Avatar for Ratte

I have a template singly linked list function that has a node class: [code] template <class T> class Node { T Data; Node <T> *Next; public: Node(); Node (const T&); T getData() const; Node <T>* getNext() const; void setData(T); void setNext(Node<T>*); }; [/code] and SLL: [code] class SinglyLinkedList { Node …

Member Avatar for twomers
0
103
Member Avatar for amt_muk
Member Avatar for vijayan121
0
2K
Member Avatar for daniweb2013

Hello, I'm trying to make SNAKE (Game) under C++ with using #include <graphics.h> Can anyone help me. Thanks

Member Avatar for PirateTUX
0
308
Member Avatar for raja.geek

hi all, i would like to know the all possible command line options of GGCOV tool in Linux... ex:1. ggcov program name 2.ggcov -o dir if anyone of you know this,plz give me the details... Thanks in advance..... RajasekharReddy.B

Member Avatar for Salem
0
59
Member Avatar for Koldsoul

I am writing this program to use user defined functions, must be return value functions as well. It is a modification to a program already written, and am having a couple errors that I just cannot figure out. Here is the code, the errors I am getting when I compile …

Member Avatar for Ancient Dragon
0
94
Member Avatar for eranga262154

Hi all, I want to read a stream of bites/bytes as a String. Here's what I have done up to now. Using a buffer I found that number of bytes, which include a text message from a binary file. Now what I want is to read those bytes stream as …

Member Avatar for Ancient Dragon
0
235
Member Avatar for andrax

I know this is probably an unbelievably simple error somewhere, but I can't see it. I keep getting "undefined reference to Machine::Machine()" and all of Machine's other functions. main.cpp [code] #include "machine.h" using namespace std; int main(int argc, char** argv) { Machine* m = new Machine(); m->reset(); m->run(); delete m; …

Member Avatar for Salem
0
100
Member Avatar for eranga262154

Hi all, I want to write some text(simply a string of characters) to the edit control on a click event. How can I do that. I know it is able to write something to the control using member function, [CODE]GetDlgItemText()[/CODE] by passing two arguments, control ID and string variable. Is …

Member Avatar for eranga262154
0
165
Member Avatar for DREAMWORLD

Hi, I am student of B.C.A Karnataka University Dharwad, Bijapur. Myself Krisha Jain please tell me the concept of templates and how we can access this in program(code). And some important notes on File Handling Functions in C++.

Member Avatar for ithelp
0
35
Member Avatar for bluejay_1111

New to the site, just need some help on this... Most of it is done, I just need to turn the wordInfo struct into a full-blown .h class. Any thoughts? It's attached... Appreciate it!

Member Avatar for bluejay_1111
0
168
Member Avatar for Tyster

Hi Folks, Total C++ newbie here so please excuse my errors! I have been tasked with writing a small program and I can't get it to work. Here is the task description... "A restaurant has 4 lunch combos for customers to choose: Combo A : Fried chicken with slaw [price: …

Member Avatar for Tyster
1
139

The End.