49,761 Topics

Member Avatar for
Member Avatar for anbuninja

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

Member Avatar for localp
0
130
Member Avatar for localp

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.

Member Avatar for Salem
0
33
Member Avatar for flash121

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 …

Member Avatar for flash121
0
140
Member Avatar for lostforever

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:

Member Avatar for lostforever
0
77
Member Avatar for RyanLeaf

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 …

Member Avatar for Ancient Dragon
-1
475
Member Avatar for Ben10

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 …

Member Avatar for Ben10
0
84
Member Avatar for kartouss

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 …

Member Avatar for kartouss
0
493
Member Avatar for scaraffe

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 …

Member Avatar for Salem
0
101
Member Avatar for jason0202

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 …

Member Avatar for jason0202
0
57
Member Avatar for jennyebrooke

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 …

Member Avatar for jennyebrooke
0
177
Member Avatar for kalodakilla

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 …

Member Avatar for kalodakilla
0
295
Member Avatar for rje7

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

Member Avatar for rje7
0
341
Member Avatar for mnv29brt

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

Member Avatar for dougy83
0
4K
Member Avatar for Black Magic

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 …

Member Avatar for chiwawa10
0
110
Member Avatar for Exo1337

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.

Member Avatar for vmanes
0
204
Member Avatar for nurulshidanoni

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???

Member Avatar for nurulshidanoni
0
86
Member Avatar for rsk8332

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

Member Avatar for rsk8332
0
121
Member Avatar for DarkLotus

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

0
48
Member Avatar for harryl5

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?

Member Avatar for ptaylor965
0
96
Member Avatar for complexcodes

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

Member Avatar for vmanes
0
519
Member Avatar for tformed
Member Avatar for dougy83
0
86
Member Avatar for sopel39

i'm writting some kind of intelligent pointer suppose user put const Class as typename T. how to remove const part of T?

Member Avatar for Narue
0
93
Member Avatar for knightblaze1182

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

Member Avatar for Narue
0
80
Member Avatar for darkrappaz

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 …

Member Avatar for vmanes
0
91
Member Avatar for jason0202

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 …

Member Avatar for jason0202
0
84
Member Avatar for tootypegs

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 …

0
61
Member Avatar for WilliamBaxter

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

Member Avatar for Ancient Dragon
-1
127
Member Avatar for Lensva

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

Member Avatar for Ancient Dragon
0
92
Member Avatar for blaec

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 …

Member Avatar for blaec
0
207
Member Avatar for Google Spider

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 …

Member Avatar for Agni
0
107

The End.