49,761 Topics
| |
#include <cmath> #include <ctime> #include<iostream> using namespace std; int main() { srand (time(0)); int c1, c2, c3, c4, guess, guess2; c1 = 1 + rand() % ( 9 - 1 + 1); c2 = 1 + rand() % ( 9 - 1 + 1); c3 = 1 + rand() % … | |
if i want to read some text data from an input file stream, 01. what hapence if there is no data 02. or if the input file contains errors 03. or if the out put file contains error because of lack of storage space on disk. | |
Hello, I have a class called personalAccount (which is a derived class from another class, but i dont think this will matter in this case), which should have a static array of chars, but i keep getting an error int my current default constructor and i cant seem to find … | |
hi everyone i have TURBO C++ 4.5, can i compile my graphics program on it? if yes then how? if also possible then do suggest some good tutorials or books to learn graphics in C++.:confused: | |
I, a 13 year old 'geek', am interested in programming. My initial question is whether or not should I start with C++ or Assembly? I know I probably will end up using Assembly (as I want to be able to control everything that happens with it, and I don't want … | |
Hello everyone! I need a C++ program that stores the results of product table from 1 to 10 in two-dimensional array... what i did : [code=c++]#include<iostream.h> void main() { int a[5][2],result; const int k=1; for(int f=1;f<=10;f++) result=k*f; for(int i=0;i<5;i++) { for(int j=0;j<2;j++) { a[i][j]=result; cout<<"a["<<i<<"]["<<j<<"]="<<a[i][j]<<endl; } } }[/code] BUT the … | |
Hello, I am encrypting a video using AES...The file format that i am using is .avi. In order to play the encrypted video i need to save the header information of the video before encryption to be able to display the video as a video format(.avi). I got the header … | |
I was learning about structures in C++. I had a question: [code] 1.struct integer 2.{ 3. int i; 4. integer (int j = 0) : i (j) {}; 5. integer operator* (const integer &k) const 6. { 7. return integer (i + k.i); 8. } 9.}; [/code] In the above … | |
I'm trying to write a program which will always loop. Besides that, i also use a function called wait() within the loop. The wait() function is to make sure the loop runs once each second. But one problem arise: The program used up all my CPU usage until 98% all … | |
I need to know how to have the user answer a question using yes or no and the program translating it into 1 or 0. I know this process involves a string... but anymore than that and I'm kinda lost. **Fixed second problem with the if else statement but still … | |
i came into Assertion failure during running this program, and i really don't know why, hope you guys can help, thanks a lot ^^ The program is to copy a linked list from another, the Copy function may look complicated because i'm not experienced enough to simplify it.. Without the … | |
in turbo C++ there is a function called delay(); and in microsoft compiler i guess it is sleep or msleep. what could be the possible equivalent function which can be used when compiling in GCC. using the looping technique will give different time difference in different machines. is it true? … | |
[COLOR="Red"]Poly.h[/COLOR] [code=cplusplus] #include <iostream> using namespace std; #ifndef POLY101 #define POLY101 class Poly { [B]private:[/B] int order; double *a; // Coefficient vector -- a[0], a[1], a[2], ..., a[order] // to represent a[0] + a[1]*x + a[2]*x^2 + ... public: Poly(int = 0); // Default constructor Poly(const Poly &p); // Copy … | |
Hi, i was looking on the practise question sticky and i came across this question, Write a program that allows you to input students' scores and weights. The program should then calculate a weighted average and score based on the data inputted by the user. (Beginner) I'm not going to … | |
Im stuck on this problem for an assignment and am looking for a push in the right direction. Write a value-returning function, isVowel, that returns the value true if a given character is a vowel and otherwise return flase. | |
If i have 2 array contains data 1 50 2 30 3 40 4 70 if I want to sort in descending order which take nombor and data together... 4 70 1 50 3 40 2 30 How??? | |
In my program, I pick a pivot p from a database S of strings, compute the median r of the distances of the string objects to p and then divide the objects into roughly equal-sized subsets S1 and S2 as follows: S1={o ε S \{p}|d(p,o)<r} and S2={o ε S \ … | |
I want to parse strings in an XML file. Example: [code] <TestOptions> <Testing> <Tester>GETME</Tester> </Testing> </TestOptions> [/code] What I want to do is get the "GETME" contents there between the <Tester> tags. I've Googled, searched this forum + others and came up with A LOT of results such as Xerces, … | |
I am currently working on creating a new game using VB.NET 2.0 framework in visual C++. Does anyone know of any Visual C++ codes I could use to help? I have also downloaded the Dark GDK gaming extension for visual C++ 2008 can anyone help me? | |
I have to write a program that created 2d array but store all data in a dynamically allocated 1d array. I have function definition and I know how to write up other functions but I need to overload operator() to aceess the array. Here is the definiton : [CODE]public: Array(double,double); … | |
Can all for statements be written as while statement. Vice Versa? | |
i'm writting some kind of intelligent pointer suppose user put const Class as typename T. how to remove const part of T? | |
I am having a problem because my data is not able to access my private member functions even though i have multiple friend functions and i don't know what i am doing wrong. [code] /*Header File for Binary Tree April 2008 Language: C++ (Microsoft Visual Studio 2008) */ #ifndef BINARYTREE_H_ … | |
hi there i m a little confused about this problem, here is the question: Prompt the user for a descriptor and value, and add these to the array. Print the descriptors and values, including the new one. so my programs ask the user for the file name(usually one with names … | |
Hi everyone! I'm trying to write a program which can run a loop without interrupt but still can accepts input from user anytime. My program is like this: A bunch of word will drop down(using looping) User have to enter letters for each word but the words will still continue … | |
hi, im just after a bit of input from some of you guys as reagrds to a new programming task i thought i would try and attempt. I would like to create a histogram of an image. I hope ive got my termanology right but i think thats a graph … | |
I have done this based on the other post ....... all I need is too arrange the words entered first the biggest word , then the smallest word and then the remaining word please do tell me what ad to this [code=cplusplus] #include <iostream> #include <vector> #include <string> #include <algorithm> … | |
the code is supposed to take 1-10 char word and copy the word into another array. it somewhat does that but some mysteries are included [code=c++] #include <iostream> using namespace std; int main() { char word[10]; cin>> word; char *Arr; int index=0; for (int i=0; i<10; i++) if (word[i] >= … | |
Hi I need some help with these C++ programs in Dev C++: #include <iostream> using namespace std; int main() { std:string str, str2, str3; std::cin >> str; std::cin >> str2; std::cin >> str3; std::cout<<str.length()<<std::endl; std::cout<<str2.length()<<std::endl; std::cout<<str3.length()<<std::endl;[/QUOTE] I type in a word for each string and I want to organise the … | |
Hi, This program is supposed to ask the user how many numbers they want to sum up and then take all the numbers one by one to give the final result. Its working but perhaps you all professional programmers will point out some flaws in it. [CODE] #include <iostream> using … |
The End.