51,593 Topics
![]() | |
First off, I'm a complete and absolute programming newbie and a bit of an old fart to boot, so I'd appreciate a gentle-but-firm correction if I'm pushing the wrong buttons here. I'm slowly working through a used copy of Prata's C++ 5th edition, but something's not working in my version … | |
Example of what im trying to do: [U]Definition: test.txt[/U] Apples //line1 Coke //line2 Money/line3 [CODE] #include <fstream> using namespace std; fstream teststream; teststream.open("test.txt"); string line1; string line2; string line3; [/CODE] //I want it so line1 = apples //I wan tit so line2 = coke //I want it so line3 = … | |
Hello friends , I am doing a project about [B]Video Streaming in J2ME[/B] . For that project i want to setup a [B]Video Streaming Serve[/B]r in my system (Windows XP). I got the Source code of a Video Server written in C++ form [B]sourceforge.net[/B] . But the documentation explaining that … | |
So here is the problem. This won't compile. It always gives an error like : d.cpp:24: error: ‘string’ was not declared in this scope d.cpp:24: error: expected ‘,’ or ‘;’ before ‘{’ token Compilatie failed. [CODE=C]#include <iostream> #include <string> #include <stdlib.h> #include <time.h> int d(int amount, int dots){ // d(X,Y) … | |
Time limit : 10 secs. (The program must produce output for all test cases within the stipulated time) A spaceship carrying a convention of high ranking officials had a close shave with a meteor. They are now scattered over the surface over a meteor and the spaceship is beyond repair. … | |
I have searched for a way before what the most effective way and in this case important the fastest way is to seek backwards in a file to read the very last line in a file. Like in this case I want to search from the end and backwards to … | |
hey everyone, I am working on a project where I have a C++ library (a precompiled library ) that would be used in my application. My application is a Windows based console application.I am working on VisualStudio 6.0. I would like to add GUI to this application of mine. Could … | |
Write a program that will ask the user for 10 numbers, store them in an array, print the array, and print the average of the numbers entered. You should: All steps should be pseudo-coded before actually going to the computer, and you will be required to submit the pseudo-code of … | |
I wanted to get some opinions on a good visual c++ book to buy. I am intermediate level when it comes to programming. I have already been through a class on C and almost done with my class on C++. So I want a book that is heavy on the … | |
I installed Dev-c++ 4.9.9.2 but "devcpp.HLP" file doesn't exist in HELP folder! Does anybody know where can I download it? | |
I am trying to get a value from a specific cell in a dataGridView. I know how to choose a Row / Column but not at the same time. I have tried to get the value from row 3 in column 2 like below. But I cant find a Column … | |
Hello Everybody, I m working on a IRC Chat application project. I would like to know how to insert hte bitmap into the chat window. I have got a few code snippets in MFC & its working perfectly in MFC. But i cant convert it into Win32. Can anybody pls … | |
Ok we have been creating this calendar in our intro to programming class for about a week or so, and right now I am stuck on getting the start day of each month. I was thinking it should be total days (days in month + total days from 1800 - … | |
The problem in this is that the program accepts a string with spaces [B]only for the first input[/B] and not for the rest of the inputs. It seems that getline only works for the first input. How can you make the vector store string with spaces (as elements of the … | |
Hi Daniweb I'm not really new, I've been lurking on the site for a while now, and I've suddenly felt the urge to start contributing. Of course I need to actually have something worth while to contribute.... Anyway, I'm java and C++ programmer (depending on what I'm working on) and … | |
Hey Guys, I have a text file that has numbers in it. And I need the program I am working on to search it as an array. How do I do that? | |
I'm having difficulties thinking through the logic of my natural mergesort program. I think I have the split working correctly, but my merge doesn't seem to be working at all, and the pseudocode in my book and what I've found so far on the web is fuzzy. This is a … | |
![]() | I am trying to make a code, where the points are not working. The points always give an odd number. Can you try it, if you can see a problem, I would love help. [CODE]#include <iostream> #define cls system("cls") #define pause system("pause") #include <string> using namespace std; class games { … ![]() |
I keep getting these errors. I'm so lost please help... fairly new to c++ programming. hashheader.h(8) : error C2144: syntax error : 'int' should be preceded by ';' hashheader.h(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int hashheader.h(14) : error C2061: syntax error … | |
But now can't finish it.. I can't figure out how to make the board display after every turn. Can anyone help? #include <iostream> using namespace std; void showBoard (char t[3][3]); int main () { char player; char t[3][3] = {{'1', '2', '3'}, {'4', '5', '6'}, {'7', '8', '9'}}; int place … | |
[code]/****************************************************/ /* File: Binomial Numbers.cpp */ /* */ /* Created by: Regine R Calinda */ /* Date: November 9, 2009 */ /* */ /* Program to compute binomial coefficients */ /* */ /* Inputs: (keyboard) */ /* Two positive integers (n & k) */ /* */ /* Output: */ /* … | |
Hello, I am trying to use the CImg library to put images into C++, can someone help? I don't know how to use this program... PLZ HELP | |
I have a small problem with string. How can I make the output str to be every single string i.e: string str="You are a good writer"; to be: str1="you"; str2=“are"; str3="a"; str4="good"; str5="writer"; //---------my_test_code,but not working yet. #include <iostream> #include <string> using namespace std; int main () { string str; … | |
I have a seg fault I can't seem to be rid of. Basically I'm building an AVL tree and I'm stuck on the insert method. gdb says it is occuring on the line with: while( temp != NULL && temp->key != k ){ Would someone please help? Thank you in … | |
Hey, I need to create some pseudo code for a class and I dunno if I've done it right or not. Any help? [code] Begin class Employee Initialise empty constructor Employee Initialise constructor Employee with parameters Define prototype for method getID(as integer) Define prototype for method getFirstName(as char array) Define … | |
I have 2 main if statements inside this for loop (lines 7 and 56). I'm trying to get so that if after all the iterations are complete, i.e. j = 51 the first and second if statements are not satisfied, then it will print out an error message. I have … | |
Ok. I've been working on a pacman game using C++, and OGRE. Things have been going good, but I have run across a problem with the collision detection of pacman hitting the walls. Before I explaing, here is some of the source code. PacpersonObj Class Header [CODE] // PacPersonObj.h // … | |
This is the problem: Write a program that reads in an array of type int. Provide facility to either read this array from the key board or from a file, at the user's option. If the user chooses file input, the program should request a file name. You may assume … | |
i have to write a program in c++ that reads numbers(weight of an item) from a file until now i got it:) and then place this items in boxes.the goal is to use as less boxes as possible.Each box can weight no more than 10. place each new item in … | |
'Learning CPP' programmer here. So, bear with me. First off : [B]STRCAT : [/B] [url]http://www.cplusplus.com/reference/clibrary/cstring/strcat/[/url] When clearly the definition says : [CODE]char * strcat ( char * destination, const char * source );[/CODE] Why'd they use char str[80] in the example??? What types can be used? | |
i have a problem : Write the definition of a function, isReverse , whose first two parameters are arrays of integers of equal size, and whose third parameter is an integer indicating the size of each array. The function returns true if and only if one array is the reverse … | |
Hi, When I want to run a program in eclipse, I get "Binary not found" error . I have MinGW in c: root and I have added C:/mingw/bin to environment path . | |
Here is the program: int i,n; double v_in[20+1],v_out[20+1]; cout << "\ninput n ? "; cin >> n; for(i=1;i<=n;i++) { cout << "input v_in[" << i << "] ? "; cin >> v_in[i]; } // reverse v_in and store the result in v_out for(i=1;i<=n;i++) { v_out[i] = v_in[n-i+1]; } cout << … | |
Hi, I am trying to see to which key the iterator is pointing in a map. is there a way to do so. Also, would it be the fastest way to store unique keys in a map. [CODE] mapType::iterator it = cube.begin(); mapType::iterator its = it; std::advance(its,1); for(; it!= cube.end(); … | |
is there any vay to access iterator's index value without using another variable in the for loop? | |
lets say i had this int times cout<<"enter times you want to repeat"; cin>>times; ----> cout<<"Hello what age are you?"; cin>>age; <------- how would i get it to repeat this section of codes the same amount as the user inputs? but make it that if he input repeat by 5 … | |
This is my first post here, but I have been using the forum for many months and up untill now has been able to answer all my problems without me actually asking anything. So thanks in advance for all the great work you guys do, you have been fantastic in … | |
Hi, I am trying to let a string(a sentance) to be red into mysql.but I only can do it within one word, how can I do more? this is my code: //---------------------------------- sql::Driver *driver; sql::Connection *con; sql::Statement *stmt; sql::ResultSet *res; driver = get_driver_instance(); con = driver->connect("localhost", "root", "qwerty"); con->setSchema("menagerie"); stmt … | |
Hi, I am trying to read he has map starting from the second key instead of first key. I have two loops. One for loop iterator reads from the beginning of the has map. And the second for loop is trying to read from the second key of hash map. … | |
Hey there, please could you tell me if the CRC cards that I've created for my classes are alright please? There are 4 classes: Employee Manager Game Platform Manager inherits from Employee Game assocates with Platform Employee + Game are super classes Thanks :) P.S please find document attactched. | |
Hello, im doing a project and need some help. my project is have to make a program for 5 judges. at the start the first thing asked is how many competitors are there. then it asks the first judge what hes gives for the first competitior, then what the second … | |
I have this program that is supposed to read part numbers from a text file. 101-110, 301-310, 501-510 and put them into a hash table. It will prompt for one of four algorithms to be used and then continue to load the part numbers. Everything seems to be working okay, … | |
Hey can anyone tell me whats wrong with my code? I'm getting a program freeze. [url]http://i47.tinypic.com/wh1ez5.png[/url] I'm doing a binary search tree, BST.CPP [url]http://pastebin.org/57667[/url] Person.CPP [url]http://pastebin.org/57669[/url] TreeNode.CPP [url]http://pastebin.org/57670[/url] Main---Where I call the searchTreeInsert function [url]http://pastebin.org/57674[/url] | |
Hallo all, I have a question for implementing Inheritance in C++. I think I miss the concept of inheritance C++ somehow, because the second class can not take the parameter from the first class.. I need to use a class Carbol and Carbol2. In Carbol2, I need to add a … | |
Hi! I am doing a C++-program which I have to use functions. The program is the following: Write a function that calculates the fuelconsumption, it takes two numbers, litres and kilometers, and gives the consumption in litre per 100 km. The functions must write on screen in main. Here is … | |
Hi, I have created a generic linked list in which different objects can be added to a list as long as they inherit from my object class. My problem is this: I am able to add nodes and find nodes etc. but I can't figure out how to return an … | |
I think I am missing out some logic when it comes to the backgroundworker. For this scenario. I am using a loop in the backgroundworker. Each loop I am calling an event that is writing values to a file. After writing these values, I am increasing updateValue. The problem is … | |
Hi, I wonder what the way is to remove dublettes from a List. ? I have filled a List like this: [code] List<String^>^ List1 = gcnew List<String^>(); List1->Add("123"); List1->Add("124"); List1->Add("123"); [/code] | |
Ok. I've been working on a pacman game using C++, and OGRE. Things have been going good, but I have run across a problem with the collision detection of pacman hitting the walls. Before I explaing, here is some of the source code. PacpersonObj Class Header [CODE] // PacPersonObj.h // … | |
Hi, I have a 2 dimensional vector containing entries such as : 10X 01X 001 I merge two rows at a time and get a new row of elements. In other words, when i combine "10X" and "01X" i might get "001" but since "001" is already there i do … |
The End.