49,761 Topics

Member Avatar for
Member Avatar for XxAndyxX

I'm wanting the program to read a line out of file. I wish c++ had .eoln()! I get: test.cpp:10: no match for `std::ifstream& != char' operator obviously because I'm comparing the wrong data types. [QUOTE] #include <iostream> #include <fstream> using namespace std; int main () { ifstream infile("test_file.txt"); while(infile!='\n' && …

Member Avatar for Dave Sinkula
0
9K
Member Avatar for hopeolicious

Can someone help me to make my program sort according to the average gallons used per car I keep geting 30 - 40 error when i try to compile it. Also my files do exist. [CODE]#include <fstream> #include <iostream> #include <iomanip> using namespace std; const int MAXCARS = 12; float …

Member Avatar for Dave Sinkula
0
153
Member Avatar for notbunny

I'm kind of lost. I'm trying to find the mode value in the list. All list are stroed in array. Anyone has any idea?

Member Avatar for notbunny
0
114
Member Avatar for tyczj

i cant figure this out, here is what im suppose to do Create a text file containing the pertinent information for the following table(not the identification row): [code]Employee No. Department Pay Rate Exempt Hours Worked 101 41 8.11 Y 49 722 32 7.22 N 40 1273 23 5.43 Y 39 …

Member Avatar for Dave Sinkula
0
174
Member Avatar for mel2005

hello am in need of some help on question 7 and 11, if someone has time please also try question 15. i really don't have any idea how to do the following question, and i need to have this assignment in soon. could you please try. thank you (7) allows …

Member Avatar for marinme
0
270
Member Avatar for ellas747

I have this code that I started on but cant seem to finish it. i have to create an file and put the outcomes in it. I cant seem to figure it out. can soemone please help. thanks, john [code] #include <iostream> #include <fstream> #include <cstdlib> #include <ctime> using std::cout; …

Member Avatar for ellas747
0
182
Member Avatar for banbangou

Anybody can help to explain why "m_line.replace(idx, m_search.size(), replace);" doesn't compile in cygwin and how to change it? Thanks. [code] using namespace std; int main(int argc, char *argv[]) { assert(argc==3 && "Usage: <searchstring> replacestring> to process stdin"); string m_line; string m_search(argv[1]); string m_replace(argv[2]); assert(m_search!=m_replace); while(getline(cin, m_line)) { while(true) { string::size_type …

Member Avatar for banbangou
0
120
Member Avatar for dazzer143

i'm having a trouble getting this right .. Write a program to calculate parking fee for customers who park their vehicles in a parking lot when the following information is given: The time the vehicle entered the lot (in 24-hour format, without a colon, such as 1645) The time the …

Member Avatar for peter_budo
0
217
Member Avatar for Ghost

Hi, I was wondering if there is a way to control hardware in C++, such as opening and closing a CD drive. Thanks in advanced, C++

Member Avatar for Ghost
0
814
Member Avatar for sinrtb

im includeing [code] #include <windows.h> // Header File For Windows #include <gl\gl.h> // Header File For The OpenGL32 Library #include <gl\glu.h> // Header File For The GLu32 Library #include <gl\glaux.h> [/code] how do i link this(the opengl headers) in the cmd console window im using mingw and g++ any ideas?

Member Avatar for sinrtb
0
113
Member Avatar for mohit_t

Hi. I want to escape any special characters in the input field before inserting the data into mysql tables in C++. Here is how I am using this function [QUOTE]// Escaping special characters in the Subject field char * S = new char[strlen(m_headerSubject.c_str())*3 +1]; mysql_real_escape_string(conn, S, m_headerSubject.c_str(), m_headerSubject.length()); m_headerSubject = …

0
105
Member Avatar for bluegoo06

I got most of this too work, i talked to my teacher and he gave me some hints but i cannot get it full. The idea is to get the program to count specifically how many "a"'s there continueing through all the 26 letters. I cannot figure out exactly out …

Member Avatar for Dave Sinkula
0
170
Member Avatar for frankieb

I have forgotten how to perform this function. I need to display only the records that meet the following criteria: I only want to show records that have a quantity greater than 100. Can someone help? This is an MFC project using an ODBC database: [code]void CInventoryView::OnRecordQuantity() { // TODO: …

Member Avatar for BountyX
0
118
Member Avatar for Fasola

Right now I'm reading up on the chapter "File Processing" to help me quench my thirst for putting C++ to USE in the real world. Seems to be the most powerful subject so far. Can you please clarify the difference between Sequential Access Files and Random Access Files? What are …

Member Avatar for Fasola
0
191
Member Avatar for Fasola

I can't figure out how to write a program that will work over a network of computers? How do you get a program on one computer to carry out instructions that will affect a program on another computer or computers? Does anybody have any ideas?

Member Avatar for Narue
0
217
Member Avatar for johnson9000

I am trying to push a pointer into a vector, but my compiler gives me the error: request for member 'Add_Object' in theContainer, which is of non-agregate type 'Container(X)' Please tell me what I am doing wrong. Here is my code: [CODE] #include <vector.h> #include <iostream> class Object { private: …

Member Avatar for johnson9000
0
163
Member Avatar for Acidburn

Hello, I recently programed a hangman game, However it as flaws with are buggin me! Basically you sak the user for a guess, then the outcome is displayed... then I've cleared the screen and redraw / reload it. This wouldnt be done in the real world since rendering would take …

Member Avatar for prog-bman
0
131
Member Avatar for falaky

[B]hi alll am a new member of this this amazing community and feel good to be part of it.i required help regarding simulation of multilevel feedback queue.i have checked many samples of scheduling but couldnt got right...so can any body help me?? code of this simulation should be in c/c++ …

Member Avatar for jwenting
0
229
Member Avatar for MrNiceGuy82

Im having trouble with the Running product in my C++ program. Where is the question: > 2. Write a program that repeatedly reads in integer values until a value less than or equal to zero is entered. For each value, it should print the product of the numbers from 1 …

Member Avatar for Narue
0
122
Member Avatar for jhdobbins

Just curious how you feel about a few things... First, how do you feel about operator overloading? Our next project "can" involve it if we chose and I think it would be easier that way, but the TA's said some people think its a bad idea. I was just trying …

Member Avatar for jhdobbins
0
101
Member Avatar for mb1

I have to write a function that reads a string and outputs only the consonants. example: string: adadad output: ddd I wrote a program without the function and it works. Now I'm trying to change the program to use the function. As of now my only error is: error writing …

Member Avatar for Narue
0
97
Member Avatar for Auto

Can the [I]main() [/I] call be embedded within a class? At work yesterday I caught a snippet somewhere, and I noticed [I]main()[/I] was inside a class, something like the following: [code] [B]class[/B] personnel { [B]void[/B] in_prev_data(); [B]void[/B] in_new_data(); [B]int[/B] main( [B]int[/B] argc, [B]const char[/B] **argv ); [B]void[/B] process_data(); [B]void[/B] pack_data(); …

Member Avatar for Auto
0
145
Member Avatar for Tyreses

Hello, i'm just starting to learn the very basic's of c++ but what i need is either a link or someone with alot of patience for c++ sockets, i'm planning on making a direct connection message encrypted chat program, but i can't find any eliable easy to use sites for …

Member Avatar for Tyreses
0
228
Member Avatar for atrixnet

When trying to compile a C program including the code below, I keep getting this error and I don't know what to do to fix it. Please explain if you can! Complete code may be downloaded from my website at [url]www.atrixnet.com/cquestion.zip[/url] (It's only 2 Kb) I suppose I'll attach it …

Member Avatar for Narue
0
614
Member Avatar for pink

:sad: There is a programming question. This is searching program. there is a string array. In this string array ther is a sentence. I get a word from the user . When the user's word is match with the sentence that is in the string , a message will appear …

Member Avatar for peter_budo
0
85
Member Avatar for pink

:( There is a programming question. This is searching program. there is a string array. In this string array ther is a sentence. I get a word from the user . When the user's word is match with the sentence that is in the string , a message will appear …

Member Avatar for pink
0
178
Member Avatar for weziw

Could someone please help me with my code for the hangman game. The problem seems to be with the playGame() functions while loop. [CODE] #include <iostream> #include <fstream.h> #include <cstdlib> #include <cstring> #include <ctime> //To generate a random seed //The function prototypes void DrawState(int state); //Draw the hanging progress steps …

0
90
Member Avatar for thomasisaac

Hi, I am currently writing a C++ API for Unigraphics(CAD Program) as part of my final year uinversity project. In the example programs im modifying, there is alot of use of '*' and '&', in the context: When defining variables: char *feature_select = "Please Select Features"; void *filter = NULL; …

Member Avatar for invisal
0
154
Member Avatar for MaxC

Hello all, what do you think the answer following question is? The cin.getline function: a) reads a fixed number of characters as a string into a character array. b) reads a line as a string into a character array. c) reads a string up to the first blank space. d) …

Member Avatar for azeembutt
0
280
Member Avatar for mehdy

The End.