49,761 Topics
| |
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' && … | |
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 … | |
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? | |
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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
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++ | |
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? | |
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 = … | |
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 … | |
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: … | |
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 … | |
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? | |
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: … | |
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 … | |
[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++ … | |
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 … | |
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 … | |
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 … | |
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(); … | |
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 … | |
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 … | |
: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 … | |
:( 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 … | |
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 … | |
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; … | |
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) … | |
The End.