49,761 Topics
| |
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) … | |
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(); … |
The End.