51,593 Topics
![]() | |
How to change this data sturucture from vector <int> total; to float total;? because if I change it to float teher is many error.... [code=C++] #include <iostream> // std::cout #include <fstream> #include <iomanip> #include <string> // std::string #include <vector> // std::vector<> #include <algorithm> //std::for each() using namespace std; // import … | |
i have to make the C++ program that will have the user input some test grades and exam grades and their personal info then output their stuff in the end. i have almost the whole thing done, but i would compile it throws up a list of 30 erros and … | |
I'm looking for a bit of advice. We're getting to the point in our game development where I need to start thinking how we're going to integrate scripting into the game engine. I was looking at Lua, but am also interested in what Perl or Python might be able to … | |
[code=cplusplus] int Seats::AddEntry() { std::cout << "Please enter your desired seat position"; std::cout << endl; std::cin >> position; ofstream SaveFile("Traveler.txt",ios::in); SaveFile << "Your Seat postion is...:"; SaveFile << endl; SaveFile >> position; SaveFile.close(); return 0; } [/code] This is just a snippit of my code...This function is one of 3 … | |
The following script was posted as a solution to a problem I did in school, however, when I run this exact script I get 3 warnings and the script will not complete. I have also attached the warnings. They are below the script. Any help is greatly appreciated. [code=c++] #include … | |
Hi, I'm embedded c coder and relatively new to c++. I'm working with borland 6. What i'm trying to do is call my "SerialThread" named worker thread which processes the line. Call [code] //char input_sentence[9]; this includes the textline "ANGLE 360" char * buff = input_sentence; thread = _beginthread( SerialThread, … | |
Hello folks I have a question to ask in regard to functions and passing information between them. I'm taking an problem solving class and well the instructor went from simple cout and cin to functions and has been really vague since the class is mostly on problem solving and not … | |
Design a program that reads several lines of text from the keyboard and prints a table indicating the number of occurrences of each letter of the alphabet (a to z) found in the text. If a non-alphabetic character is found, simply count how many were found and display that total … | |
Hi, I have two questions, if someone can help me please I need it urgently!! Thanks to all! 1. Tree class Make a function that counts the number of nodes with two children in a binary tree. 2. List class Make a function that prints the elements of the list … | |
I am trying to create an ethernet socket inside a thread. The code works outside of the thread, but fails inside of it. Does anyone know what the problem is? Do I need to set up the socket outside of the thread? It compiles and runs, just fails to connect … | |
I am stuck on a problem. I am given code and I am suppose to do the follwong sway fucntion. The last three lines of code in the function selection_sort perform an essential operation that is commonly found in sort algorithms. Replace those three statements with a call to a … | |
I want a name displayed when the letters beside it is entered from the keyboard eg when "ABC" is entered, Abraham is retrieved from .txt file when "CME" is entered, Camille is retrieved from .txt file A sample of the text file is below: CODE NAME ABC Abraham CME Camille … | |
[code = cplusplus] int serials[MAX_PAX]; for (int i = 0; i <MAX_PAX; i++) { int max = 0; serials[i] = randomnum(); // store random num in int serial max++; cout <<"serial" << serials[i]; break; } [/code] I have a return function that generates a random number, i want to store … | |
Hi Everyone , I have 3 questions that need explaination (only explain),then i will try to solve them. [COLOR="green"]Q1[/COLOR]: Let g(x,n) = 1 – x2/2! + x4/4! - … …+(-1)n x2n /(2n)! Using a loop write a program to calculate g(x,n). [COLOR="green"]Q2:[/COLOR] write a program that accepts a positive integer … | |
Hi everyone, big time c++ newbie here, in fact I don't know too much at all about what I'm doing. But what I am trying to do at this point is read into a file created by my program, check and see if a name to be inputed is exists … | |
hi friends This is my assignment I have to send it today I have many tests please You are my hope befor I drop this course (C++ course) Please try to help me to solve it [/COLOR][/COLOR][/COLOR] Write a C++ program that repeatedly display the following main menu : The … | |
hi poeple , i am doing a project by dev c++ ,i need to make a function for calculating the Hadamard Matrix , i tried alot but i could not ,i also want to know how can draw sine wave or square wave by c++, i am using windows vista … | |
i have text file with a series of words in it. some word contain the expression '.zip' , i'm trying to rerad the characters of the file and replace the .'zip' with '.rar' this is my prog, bu it's not responding [code=cplusplus] #include <iostream.h> #include <fstream.h> #include<stdlib.h> #include<conio.h> void main() … | |
This one of those typical Rational number programs. It takes a user-supplied fraction and then another. Then it does the 4 basic math operations on it. Finally it compares the fractions to each other. I have the program working fine. I just want to know how to fix this warning … | |
Hey guys, I was just reading again about classes and their functions and i made some code, the thing i want to do is have a function, eg. [CODE=C++]void Cat::Sleep()[/CODE] and have it to have three cout's and choose one of them to say at random, Heres my code. [CODE=C++]#include … | |
Hello, I have the next problem, I want my turbo c++ explorer program are able to speech text. I download all SAPI and I know that the funtion for text to speak are in the library VText.dll. How I must configure the program to access this functions? | |
Hey all. I'm making an online game. It uses XML maps, and I was wondering... what's the best way to transfer an XML file over a socket? I want my server to send an XML map whenever it's requested, but I dunno how I'd get the xml from the other … | |
I have been reading some of the posts on reading integers from files but I have not seen any on reading integers from formatted files. I have a file which is a 6 X 6 matrix consisting of integers separated by tabs. I want to read each number into an … | |
Hello all, I am badly in need of a simple to use Matrix library for C++ that can handle complex data type.. I am working in Bloodshed Dev C++ under windows XP. Waiting anxiously if anybody can be of help!! Imtnan ![]() | |
i using seekp() function to change the pwd, but it can only change the first row of peter's pwd. Wat i wanted was to change only the pwd that belongs to only mary if marry has login. How can do it? need some advice!!! this is wat my text file … | |
I just started using Eclipse for developing C++ projects. I wanna ask u guys if u know any good forums for posting regarding this IDE, or if some of u guys arround here use it also, so I know if it would make sense to post arround here or not. … | |
I kepp getting errors in my following code [code=c++] #include <iostream> #include <queue> #include <ctime> using namespace std; template <class TYPE> void randomInit (TYPE array[], int size, int mod) { for (int i = 0; i < size; i++) { array[i] = rand()%mod; } } // Prints Array template <class … | |
i'm trying to write a program that reads a text from the user(keyboard) sentence by sentence and then prints the 'morse code' of them char bay char on a text file. I'm just testing it for the letter 'c' to start with, but it doesn't seem to be working well … | |
Hi All, The CPU Utilization in my program is too high when I am trying to read a file. Can you please suggest a better method. Please find code snippet that I am using. [code=cplusplus] void SyslogReader::isTrapRaisedFromTestClient(list<SNMPTrapInfo>* pListSNMPTrapInfo, const int nSemID) { int nWaitCount = 0; const int SYSLOG_MAX_MSG_LEN = … | |
What is the difference between char* and string? I mean, if char* can also use string's functions or can there be "=". Thanks all the same. | |
Hi All, Please keep the laughing until the end of this request. The new assignment that I have to work on, is a string sorter. I am to ask the user to enter how many names does he/she need to sort, should be a number between 2 and 25. Then … | |
Hi, I have been asked at work to amend a piece of code for a particular system such that it will search through a .dat file for certain strings and return the relevant data associated with those strings. At the moment data is read in from 3 text files where … ![]() | |
Hi, I was hoping someone could shed some light on this for me. I am stuck on an assignment. I have spent 3 weeks on it and have almost finished it. I have so much going through my head at the moment I just need some help. Please. I do … | |
I'm self studying C++ and I'm actually back-tracking a bit in order to clarify things. My question revolves around why in the following code is the [icode]cin.fail() == true[/icode]. [code="cpp"] #include <iostream> using namespace std; int main() { char getdata; cout << "Enter one character: "; cin >> getdata; cin.get(); … | |
I am trying to solve a problem from a lab challenge. I'm having trouble on how to output the table and it must be done in [B]top-down design.[/B] Use a two-dimensional array to solve the following problem. A company has four salespeople (1 to 4) who sell five different products … | |
I have this program that suppost to ask user to select option: [option] a. Start a new list b. Add a Node to the end of the list. c. Add a Node to the beginning of the list. d. Add a Node at a specified position in the list. e. … | |
Ive posted this on another forum, and haven't gotten very far. I had a few skillful coders give it a go, and no luck. We got errors... I'm trying to make a console app... Transparent, or translucent. (See-through) Ive tried: [CODE]#include <iostream> #define _WIN32_WINNT 0x0500 #include <windows.h> using namespace std; … | |
I have a problem in reading from file. I want the program to keep on reading from the file and store it in a buffer until \n\n is encountered. Then I want it to input an integer value from the user and then when the user presses enter it should … | |
hey guys i have to implement and test a header file here bitmap..implementation uses a 2-dimensional vector of bool called grid and its dimensions, numrows and numcols. A zero is stored as false in the grid and a one is stored as true. The member functions should manipulate grid, numrows … | |
Hey guys, I am having trouble getting data from a file into a linked list. I'm very new to c++ and am finding it difficult to understand but am trying my best. I need to get a text file and insert each character into a seperate node in a linked … | |
Hello everyone! I have a function to get data from a database. I want to put it into matrix of some sort so that I can have something like a spreadsheet (multiple columns and rows, depending on data). It needs to be dynamic. Ok code so far - [CODE]//--------------------------------------------------------------- template … | |
I need a do while loop in this but when i try to put one in it errors alot could someone show me the proper placement please. i use dev C++ compiler [code] //Login #include <iostream> #include <string> #include <conio.h> using namespace std; int main() { cout << "\tWelcome to … | |
I need help figuring out how to do error checking with military time. So that if the value is over 59 (ex 1372) it gives an error message. My C++ knowlege is fairly basic | |
..for manipulation in the main part of the program. Basically Im trying to create a Class function that asks the user to enter in 3 different teams and their nationalities and then redisplay them when the main calls that function. [code=c++] struct squadre { string teamn; string nat; } clube … | |
A component developed in C# is used by application written in VB 2005. The component includes a field for data entry of numeric values, the field becomes active for data entry upon a mouse (touch-screen) click. When the component's data entry begins I want to activate a virtual keyboard on … | |
Hello, I am sorry if I am boring you, but I know of toupper() and tolower(). Is there a toProper() in C++? Proper case is the first letter of the word is in uppercase while all other letters of the word are in lowercase. Is there a way I can … | |
Hi I'm still in the basics in c++ and I really need some help in coding my 1st semester's project. I am required to create a program that is to be used at a tollstation to keep account on the number of vehicles using the road, the fees charged and … | |
Hey guys, I'm here once again! I need help for something that is simple, but I'm not getting the results I should be getting! I want my output to look like this: [B]Enter hours worked: 44 Enter pay rates: 10 Hours worked: 44 Pay Rate: 10 This week's salary: 460 … | |
how can i change the data of my text file with the user input? eg. i prompt for user to enter new no. and with this new number it will replace the old number with the new one. i know i need to wite to the file but how can … | |
If I have a 40,000 word dictionary in the file: LatinDictionary.txt How would I output that file to the screen? |
The End.