49,761 Topics
| |
The program says it's stopped working after I input the first number... #include <iostream> using namespace std; int average(); int main(){ char answer; cout << "Average calculator." << endl; cout << endl; cout << " Enter a stream of positive numers (0 or above)." << endl; cout << "Enter a … | |
I working with an application written in Visual Studio C++. Then program is a console application running under the DOS-prompt. The program is something like this. void main () { for ( ;; ) { do_something (); do_something_more () } } Now I need to add some code between do_something … | |
Greetings! Just want to ask how to create a C/C++ ide then link to a compiler? any advice? can I use a visual studio for creating an IDE?... Thanks Best regards, glenndr_15 | |
1. The square of an integer n is normally calculated by multiplying n by itself, that is, n2 = n * n. Another way to calculate n2 is by adding the first n odd integers. For example, 1 + 3 + 5 = 9 = 32 1 + 3 + … | |
Can someone please finish this off, i need the days to start going on the day specified [code=c] #include <iostream.h> int main() { int month;//asks for current month int days;//asks for day of start int numdays;//number of days in the month int monthstarter=1; //starts day count cout<<"Enter a month (1 … | |
I want to print the following using for loop. from the pattern, it's clear that when row and column is equal to each other it prints A that gives me A from top left to bottom right need clues A - A A - A A - A A-A ----A---- … | |
About 11 months ago I started this [thread](http://www.daniweb.com/software-development/cpp/threads/386863/declaring-const-int-causes-error-c2582-operator-function-is-unavailable) asking why I couldn't use a const data member in a class that was going to be used in an stl container. The explanations were excellent. Now my question is, what is the best alternative to having a class with BOTH a) … | |
Hi, im pretty new to c++, and im stuck on this problem, i need to assign a letter from and array of stings to an array of chars and i just cannot figure it out. any help is appreciated. I tried both and both give me errors: strcpy (newChars[j],alphabet[i]); newChars[j]=alphabet[i]; … | |
Hi, I am using C++ MFC and I wouldn't exactly call myself an expert :-). What I have is a thread drawMonitor which monitors when to draw and I would like it to call DrawLines() (which is a member function in the class) to do the drawing. void drawMonitor(void *); … | |
#include <iostream> #include<string> #include<vector> using namespace std; struct Names { string fname; string lname; void output() { cout<<fname<<" "<<lname; } void input() { cin>>fname>>lname; } }; struct birth_info { int month; int day; int year; void input() { cin>>month>>day>>year; } void output() { cout<<month<<"/"<<day<<"/"<<year; } }; int main() { string … | |
So in my program I have to use specific values obtained from an inputfile in different functions, and I couldn't figure out a good way to do this. I don't want to have to have the user input the file name for every function. I tried it this way, but … | |
Write a C program that roll a single six-sided die 10 times. Produce a random number from 1 through 6 as shown in the following frequency distribution. (Hint: use an array of counter) | |
I am having a problem in making a program that will display what time that school staff log in, their names, and the option to log out in a tabular form using multidimensional arrays in the program. Can anyone help me? | |
Hi, Im trying to figure out how to display a number from an array where it has been chosen by a random number. I have got an array with 10 different numbers (always different when program is ran). Each index is added with the previous index number So lets say … | |
Does anyone have a good method? | |
Hello I am trying to allocate a dynamic array of length that the user inputs. I have a function to this for me but it doesn't allocate the number that I want it to allocate. For example, when I input one it gives me 7 digits... heres the code: int* … | |
I have to implement Warnsdorff's Rule via an algorithm given to me by my professor. I've gotten it to work however one thing that I can't get to work is for the ending point to be one "knight's move" away from the starting point. This is my code so far. … | |
Does anyone have any experience with PODOFO [Click Here](http://podofo.sourceforge.net/index.html). I've read everything they have to offer and I admit, some of their points are a little advance for me. I'm trying to determine whether PoDoFo can be compiled as part of my c++ application so that my application is standalone. … | |
Hello so i have been making a program and decided to start on error checking. I'm asking the user to input a 1 to continue and a 2 to exit simple. I worked the code out for the error checking though when i compiled and ran the program all it … | |
Errors: 1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(239): error C2065: 'string' : undeclared identifier 1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(239): error C2146: syntax error : missing ';' before identifier 'str' 1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(239): error C2065: 'str' : undeclared identifier Code: `string str;` For some reason strings are giving me errors. | |
Hi!! If any one has the code in c++ to recover deleted files from FAT and NTFS then please post it here. It is to note that i need actual code, not the already made tools. Thanks | |
Need help to print grids of letters ..for example ABABA BABAB ABABA BABAB ABABA BABAB so when row and column numbers are the same (r == c) the program prints an A. Any clue as to how I should approach this problem will be appreciated? this is what i got … | |
If i want to print a grid of letters..for example AAAAA BBBBB AAAAA BBBBB AAAAA this is what I got so far. need some clues as to how I should approach the problem? #include <iostream> using namespace std; int main () { int n; cout << endl << "Enter a … | |
A simple project that provides an interface to encrypt and decrypt strings using the next algorithms: - AES - Blowfish - Cast - DES - Idea - Rc2 - Rc4 - Seed The project uses PoCo C++ libraries, they have a nice and easy to use interface for OpenSSL I … | |
I was wondering if there is a way to import file names from one specific folder to a text file. for example... my whole music foler. I want to create a text file for all the songs that I have in that folder. Is it possible and if yes how … | |
I modify this .cpp code into .c but it gives error: the original code is:(runs fine) [CODE]#include <string> #include <iostream> #include <stdlib.h> using namespace std; int main() { int c, s[10]; int i, j; string name; cout << "Welcome to Airline Reservations System!\n"; for (j=0; j<10; j++) { cout << … | |
Hi guys! So I need help with a small problem. I'm using a char pointer array which contains a mathematical expression. For example: "sqrt 25" Now I want to use the inbuild c++ function `sqrt(int))`. I'm first searching in the array for the letters 'sqrt' so that my custom function … | |
I've had a sudden surge of interest in an old (2007) program which is an MFC Dialog based app. So I'd like to spruce it up a bit, and one of the annoying errors is that its proper icon does not appear in the bar at the bottom of Windows. … | |
Hi I have a big (working) software written in C++ that uses SQL database, using the ADO interface. I'm currently using old ADO libraries (prior to the Windows7 SP1 problem) and wish to upgrade. I'm considering taking advantage of this need and upgrade to ADO.NET. What do you think? | |
Hey I want to make a Visual C++ program targeting x86 (and ARM) Windows CE .NET 4.20 using .NET Compact Framework. How do I do this? Thanks |
The End.