51,593 Topics

Member Avatar for
Member Avatar for henpecked1

Okay, figured that much out but I'm getting compiler errors on my object (which has data members from another object) [code] void statistics (int rolls[];int rollsize; int rollresults []) threedice tryerluk; rollsize=200; rolls[rollsize]; rollresults[16]; for (int i=0;i<201;i++) { tryerluk.rollem(); rolls[i]=tryerluk.getsumFaces(); }void statistics (int rolls[];int rollsize; int rollresults []) threedice tryerluk; …

Member Avatar for vmanes
0
310
Member Avatar for amitahlawat20

I have got an assignment question : Constructors cannot be virtual , however destructors can. Justify the statement in reference to memory leak. Please help me out figuring the answer.

Member Avatar for Ancient Dragon
0
79
Member Avatar for rsk8332

Suppose I know some indexes like 4, 7, 10,11, 13 and so on in sequence then I should put in dashes for the missing values like this: - - - 4- - 7- - 10 11 - 13 etc How do I program this? I know the indexes and the …

Member Avatar for WolfPack
0
85
Member Avatar for zargare

Hi, Can any one tell me where I can find information about data files? And I am trying to find answers for the following questions: Is there a specific structure for the data file that I use in C++? What is the best way to write a data file for …

Member Avatar for VernonDozier
0
69
Member Avatar for perseus150

I am having trouble creating an inverted half-square out asterisks. The problem requires three nested for-loops, I believe, but am unsure as how to proceed. Here is the work I have so far, with the UN-inverted half-square code in [I]italics[/I]. The inverted portion should be a simple manipulation of that …

Member Avatar for perseus150
0
228
Member Avatar for johnnyboy269

Hello, I'm new here. I've been working on a card game program for some time now and I'm just trying to make it look appealing. I would like to try and find a way so that certain characters (heart, diamond, spade, and club) rotate in one position. What I mean …

Member Avatar for William Hemsworth
0
93
Member Avatar for Jennifer84

This code is written inside a textBox event handler like this. What happens is that when you have written the word: "Hello" wich consists of 5 characters, this word will be selected, change color of "Hello" to blue, deselect the word and put the cursors position after the word Hello. …

Member Avatar for Jennifer84
0
116
Member Avatar for Jennifer84

I have a fully functional code below to read a textfile from a directory and load this into a textbox. What I have done is to put this code inside a comboBox control and what I am trying to achieve is when you select an item in the comboBox then …

Member Avatar for Jennifer84
0
145
Member Avatar for henpecked1

I have my two classes built, one actually uses the other as a data member. Now I need to call that object to fill an array and don't know the syntax to do it. The two classes are in this thread [url]http://www.daniweb.com/forums/thread114985.html[/url] The function prototype looks like this [code] void …

Member Avatar for henpecked1
0
97
Member Avatar for gothicmisery85

Ok. I've redone my project from what I had before, and I still can't get the program to add interest and charges to the balance. Help would be greatly appreciated. =========================================================== This is what I have so far in my .cpp file and my .h file: Contents of Bbankaccount.cpp ===================== …

Member Avatar for Lerner
0
212
Member Avatar for darklich13

I'm trying to write some code that will read numbers from one file and put those numbers into a list and then print the list in another file. I'm having trouble trying to get the numbers from the infile to read correctly. The program compiles ok but when the list …

Member Avatar for darklich13
0
169
Member Avatar for daviddoria

This is a very general question. I'm sure there is no "right" way so I thought I'd ask for opinions/common practice. In my file MainProgram.cpp (containing main()), sometimes I will have LOTS of functions. It seems very distracting to have a thousand lines of code all in the same file, …

Member Avatar for Narue
0
99
Member Avatar for knight fyre

I'm trying to create a parking lot system where users can enter and exit a lot. This lot should be kept on a file(s). My code compiles but my data doesn't write to the actual file. [CODE]void SYSTEM::parkProcess() { CARD IDcard; char lot; int id; string type; cout<<"Enter Parking Lot: …

Member Avatar for vmanes
0
141
Member Avatar for bhoot_jb

please check out the following two code segments and suggest which one is more efficient and worthy to use... The segments are actually constructors used to allocate a memory block for a matrix.. segment - 1 : [code=cpp] class matrix { private : int rows, columns; int *element; public : …

Member Avatar for bhoot_jb
0
116
Member Avatar for metropolisiii

Hey all. Hopefully this makes sense. I new to this C++ technique. I'm working on a project where a program will take custom html tags and convert them to openGL code that can be pasted in a C++ program. That part works well. My question is how do I take …

Member Avatar for Ancient Dragon
0
70
Member Avatar for dolphin.rise

I have just joined your website. I am attending B.Tech in Computer science and have completed upto inheritance in c++. My first question here is: What is the relationship between inheritance and composition and why the two can be used in place of other.

Member Avatar for Ancient Dragon
0
128
Member Avatar for dolphin.rise

I am not able to understand the following points in regard to difference between C and C++, 1.The comma operator can result in an "l-value" (a quantity that can be used for the left-hand side of an assignment) in C++, but not in C. 2.Enumeration constants (enum values) are always …

Member Avatar for Narue
0
129
Member Avatar for knewc

[code] #include <iostream> using namespace std; int fib(int n); int main() { int n, answer; cout << "Enter number to find: "; cin >> n; cout << "\n\n"; answer = fib(n); cout << answer << " is the " << n << "th Fibonacci number\n"; system("PAUSE"); return 0; } int …

Member Avatar for BlackJavaBean
0
107
Member Avatar for Jennifer84

I have a coming back problem that I dont know how to get out from. If you put this code in the event handler for a richtextBox control and write this on the First line: [COLOR="Red"]1234567890 [/COLOR]//This will turn red when you press 0 If you instead right away press …

Member Avatar for Jennifer84
0
84
Member Avatar for nelsonsu

there're input1.txt command1.txt given files subject asking for create a result1.txt file with the data from the given files. there's no any bug while compile, but when running the program windows system pop out error report that: ***.exe has encountered a problem and needs to close. We are sorry for …

Member Avatar for nelsonsu
0
157
Member Avatar for prs55

Could you guys please help me to solve this pathOk function, the code is: [code=cplusplus] // graph.h #include <iostream> #include <vector> #include <queue> template <typename ItemType> class Graph { public: Graph(){ }; ~Graph() { Clear(); } void AddVertex(const ItemType& theItem); void AddEdge(int n, int m); bool Empty() const; bool EdgeExists(int …

Member Avatar for prs55
0
150
Member Avatar for dolphin.rise

I have a confusion : Is there any specific advantage of using int main() over void main() in c++ programs. Can anybody solve it ?

Member Avatar for mitrmkar
0
274
Member Avatar for * moon *

I'm new in this site ^__^ and I really love it ^.* ammmmm ... I have some problem with my assignment ... could any one help me ?? ( sorry but me english weak a little bet)..

Member Avatar for * moon *
0
191
Member Avatar for henpecked1

I'm trying to construct a semi simple dice rolling project. I have two classes, onedie and threedice. The threedice class looks like this: [code] class threedice { public: void rollem(); int getsumFaces(); private: onedie die1; onedie die2; onedie die3; }; [/code] Now, when I try to code the two functions …

Member Avatar for vmanes
0
288
Member Avatar for TheFueley

I'm trying to figure out how to write an int (as a record number) and a string (up to 12 characters) into a binary file. So in one project the binary file is created with all 5 records written to it, with blank data, eg string is empty. In the …

Member Avatar for TheFueley
0
122
Member Avatar for Jboy05

After I Prompt the user to get an integer from the keyboard, display the number on screen if it is an even number how do I write the number into a file in A:\ drive under the name OddFile.txt. if its odd. [CODE=cplusplus] #include <iostream> #include <fstream> #include <cstdlib> using …

Member Avatar for Ancient Dragon
0
100
Member Avatar for complexcodes

Hi, I am trying to do my project but I am stuck. It looks like a big project but it is not. here is the question : I am given sample output of rectangles and some code. I need to add few free functions to make the outout like that …

Member Avatar for complexcodes
0
111
Member Avatar for cpp_noobsauce

Heres my code: [code]#include <cstdlib> #include <iostream> using namespace std; //Function prototypes char GetTaxCode(void); int GetProductId(void); int GetQuantity(void); float GetProductPrice(void); char InvoiceInitilization(void); int main(int argc, char *argv[]) { //Variable declarations float gSt = .01; float pSt = .02; int productId; int quantity; char taxCode; float taxAmt; float productPrice; int shippingFee …

Member Avatar for cpp_noobsauce
0
135
Member Avatar for ulyssesmn

I've tried use a program which is will work in sqrt(n),but it got TLE.,please help me [url]http://acm.pku.edu.cn/JudgeOnline/problem?id=1811[/url]

Member Avatar for vmanes
0
86
Member Avatar for big24fan

I just finished an exam that I bombed pretty hard. I just dont know where to begin on this stuff and would love some guidance. Below is the details of the exam. - Write a program that asks a user to enter their full name. Their name including spaces must …

Member Avatar for buddy1
0
164
Member Avatar for gothicmisery85

I'm seeming to have some difficulties with a few things. I don't quite know how to get my program to add interest and charges to the balance, and I keep getting the message in Borland C++ Builder 6, "Unresolved external 'Interest(int)' referenced from C:\Documents and Settings......etc etc." and I'm also …

Member Avatar for gothicmisery85
0
139
Member Avatar for knewc

Alright! I have to make a program that computes the n'th Fibonacci number, and then use it in a program to list the first 20 fibonacci numbers, the recursive definition of fibonacci numbers is: fibonacci(1) = 1 fibonacci(2) = 1 fibonacci(3) = Fibonacci(n-1)+Fibonacci(n-2), for n>2 then modify your program and …

Member Avatar for Ancient Dragon
0
83
Member Avatar for mar000m

hello all, so can any one help me with a code in c or c++ for radix sorting code for names.... i need this for an important project for my study....if any one can help by friday 21-march

Member Avatar for Ancient Dragon
0
54
Member Avatar for lostandconfuzed

Hi guys, I'm working on a program that has to do with Goldbach's second conjecture (any even number larger than 5 can be expressed as the sum of three prime numbers). I have to write a program that takes integer [I]n[/I] (larger than or equal to 6) and finds three …

Member Avatar for knewc
0
143
Member Avatar for Jennifer84

Is it possible to know what key on the keyboard that was pressed through any of these syntax in any way. [I]textBox->KeyPress textBox->KeyUp textBox->KeyDown[/I] I like to find an if statement that says something like this, though I know this is wrong: [code] if ( textBox-> KeyPress != BackSpace) { …

Member Avatar for Jennifer84
0
102
Member Avatar for SJin

Recently I've been trying to write a bit of code that will take a string, for example "This is a string", and returns the string with the contents in reverse order, such as "gnirts a si sihT". I'll only post the function that will do this. Currently, my idea is …

Member Avatar for Ancient Dragon
0
94
Member Avatar for 666kennedy

i have a formula, it is basically the result of two other previous calculations and it gives me an eror message saying that i cant use it as a function [CODE] ERRORC = (( target1 ) - ( OUTC ) )(OUTC)(1 - OUTC); [/CODE] target one is selected at the …

Member Avatar for Ancient Dragon
0
139
Member Avatar for TylerTCF

Thanks for your help earlier with the file input everyone...I have another question to ask of you. I am trying to check two vectors against each other to see if the "timeanddate" match up. Then try to output the ones that do match. I am getting errors from the if …

Member Avatar for mitrmkar
0
125
Member Avatar for Lensva

Say i ask a user to input a number, which will be the return value of one of my class members. How do i make it so that it would redirect me another class member, depending on the number input?

Member Avatar for Lensva
0
98
Member Avatar for Traicey

This program is using setw() and setfill() it supposed to output the stars I have included the sample output at the end of my project I hope u gona be able to read the code cause my coding does not print the stars the way they have to be instead …

Member Avatar for Narue
0
2K
Member Avatar for 666kennedy

firstly id like to thank people for helping me with my earlier problems. anyway, for this program im working on, i want the user to be able to select between two patterns. eg. pattern1 makes x=1 and y=0 pattern2 makes x=0 and y=0 i tried using if statements, but it …

Member Avatar for Narue
0
138
Member Avatar for Jboy05

Do you see anything wrong with this if so let me know [code=cplusplus] #include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main () { int num; ifstream AFile; AFile.open('a:\\OddFile.txt'); AFile << "Enter an integer number please: "; cin >> num; If (num % 2 = 0) AFile << …

Member Avatar for Jboy05
0
143
Member Avatar for TylerTCF

Anyhelp with the ostringstream and datastream line would be appreciated. Can't seem to get the data to actually write to the text file...No data in results.txt, but the file is created by the program when I run it... [CODE] ofstream DataFile3("results.txt"); cout<<"Writing...Please wait...."<<endl; for (a=0; a<Search.size(); a++) { cout<<Search[a].date<<" "<<Search[a].time<<" …

Member Avatar for Narue
0
128
Member Avatar for Jennifer84

I have a wondering. I have put this code in the richTextBox1 event handler. What happens is when you have written 11 characters, the 10 previous characters turns blue. What I wonder is that this code selects and deselects these characters wich can result of "blinking" in the textbox sometimes …

Member Avatar for Jennifer84
0
97
Member Avatar for 666kennedy

this isnt working, i think it has something to do with the natural exponential, its a calculation of the sigmoid function. it basically should read 1/(1 + e^-((W1A*pix1)+(W2A*pix2))) this is what ive coded [CODE] OUTA = 1/(1 + exp -((W1A * pix1) + (W2A * pix2))); [/CODE] please help me.

Member Avatar for 666kennedy
0
309
Member Avatar for krichard89

For the code posted below, a hangman game, how would I make it so after the conditions in the loop are evaluated, it goes back and asks for another letter input without an infinite loop? [code=c++] // Kevin Richard // Hangman.cpp // Basic Hangman console game /* Changelog: -added char …

Member Avatar for Ancient Dragon
0
81
Member Avatar for TylerTCF

Need a recommendation on how to proceed with this task...I am starting new in C++ (after taking it in high school 11 years ago it has been forgotten and has changed alot). I have put the code I have below and some sample lines of data...any recommendations on how to …

Member Avatar for vijayan121
0
172
Member Avatar for sisi

Hello guys, I just join your site to get help about my coding programme class c++. I do have to modify my programme that the out put will show the form sum=1+3+5+7=16. Can you please help me out thxx . Programme is adding odd integer : [code=cplusplus] # include <iostream> …

Member Avatar for lAmoebal
0
81
Member Avatar for scorpio40330

I have an upcoming assignment, in which I have already completed. But I was just curious if anyone could look it over and give me some input on it. I am pretty confident that I have done it correctly. But I think I have became particularly attached to this assignment …

Member Avatar for Daphene
0
119
Member Avatar for Mahen

Hi, Merry cristmas and Happy new year to everyone. I am writing this because i am having problems with my compiler Borland C++ Builder 6 Evaluation Version :-( The problem is that after I have designed a GUI program, Build it and run the executable, Windows declares a Stack Overflow. …

Member Avatar for Mahen
0
431

The End.