51,593 Topics

Member Avatar for
Member Avatar for nurulshidanoni

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 …

Member Avatar for littlestone
0
294
Member Avatar for cmoney12051

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 …

Member Avatar for cmoney12051
0
129
Member Avatar for PirateTUX

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 …

Member Avatar for hacker9801
0
112
Member Avatar for saint.h

[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 …

Member Avatar for Ancient Dragon
0
285
Member Avatar for big24fan

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 …

Member Avatar for Ancient Dragon
0
134
Member Avatar for f_rele

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, …

Member Avatar for f_rele
0
1K
Member Avatar for Gresakl

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 …

Member Avatar for Lerner
0
1K
Member Avatar for rsuh2000

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 …

Member Avatar for Lerner
0
209
Member Avatar for didi00

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 …

Member Avatar for Lerner
0
100
Member Avatar for Nemoticchigga

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 …

0
46
Member Avatar for Moporho

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 …

Member Avatar for Moporho
0
251
Member Avatar for Princequarles

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 …

Member Avatar for jbennet
-1
94
Member Avatar for Seamus McCarthy

[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 …

Member Avatar for Seamus McCarthy
0
99
Member Avatar for computer engW

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 …

Member Avatar for computer engW
0
83
Member Avatar for wleemitch

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 …

Member Avatar for wleemitch
0
98
Member Avatar for only me

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 …

Member Avatar for deeed
0
313
Member Avatar for alijafari

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 …

0
48
Member Avatar for scream2ice

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() …

Member Avatar for scream2ice
0
156
Member Avatar for TheFueley

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 …

Member Avatar for TheFueley
0
182
Member Avatar for Black Magic

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 …

Member Avatar for Black Magic
0
97
Member Avatar for pierovic

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?

Member Avatar for Salem
0
231
Member Avatar for hacker9801

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 …

Member Avatar for Salem
0
161
Member Avatar for demroth

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 …

Member Avatar for demroth
0
144
Member Avatar for imtnan

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

Member Avatar for iamthwee
0
67
Member Avatar for picass0

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 …

Member Avatar for Ancient Dragon
0
152
Member Avatar for kux

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. …

0
71
Member Avatar for whoknows101

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 …

Member Avatar for whoknows101
0
304
Member Avatar for scream2ice

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 …

Member Avatar for Ancient Dragon
0
129
Member Avatar for anjaliraman

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 = …

0
39
Member Avatar for dgg32

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.

Member Avatar for Ancient Dragon
0
94
Member Avatar for Waseemn

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 …

Member Avatar for ithelp
0
102
Member Avatar for B33J

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 …

Member Avatar for iamthwee
0
64
Member Avatar for a2008

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 …

Member Avatar for Nick Evan
0
148
Member Avatar for superjacent

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(); …

Member Avatar for superjacent
0
309
Member Avatar for bballj32

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 …

Member Avatar for Agni
0
281
Member Avatar for gazoo

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. …

Member Avatar for Agni
0
108
Member Avatar for bradszy

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; …

Member Avatar for bradszy
0
218
Member Avatar for jmines

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 …

Member Avatar for Agni
0
50
Member Avatar for shotjase

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 …

0
55
Member Avatar for L31chH4rdT

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 …

Member Avatar for Gerlan
0
114
Member Avatar for linux0id

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 …

Member Avatar for linux0id
0
125
Member Avatar for echoestroy

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 …

Member Avatar for echoestroy
0
104
Member Avatar for legendofme

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

Member Avatar for CoolGamer48
0
108
Member Avatar for Run.[it]

..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 …

Member Avatar for Run.[it]
0
130
Member Avatar for avnerharel

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 …

Member Avatar for avnerharel
0
302
Member Avatar for Waseemn

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 …

Member Avatar for Narue
0
90
Member Avatar for KK Murage

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 …

Member Avatar for Narue
0
155
Member Avatar for NinjaLink

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 …

Member Avatar for CoolGamer48
0
133
Member Avatar for picass0

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 …

Member Avatar for dmanw100
0
116
Member Avatar for sfurlow2

If I have a 40,000 word dictionary in the file: LatinDictionary.txt How would I output that file to the screen?

Member Avatar for Narue
0
86

The End.