49,757 Topics

Member Avatar for
Member Avatar for 666kennedy

i have a do while loop in my program. im just unsure of how to make it work. i need it to continue doing the loop until the error is between -0.1 and 0.1 i have this so far, i may have the greater/lesser than signs wrong, or just set …

Member Avatar for mitrmkar
0
56
Member Avatar for eesti44

Hey all, I am starting to work on a portprogramming project. I am not really sure where to go. I am trying simply blink an LED when it is hooked up to the serial port. Can someone give me a start on where to go. I have read several internet …

0
69
Member Avatar for William Hemsworth

Hi I have a memory leak somewhere in this code but I have no idea where. Can anybody help me out ? [CODE] #include <windows.h> #include <mmsystem.h> #pragma comment(lib, "winmm.lib") #include <fstream> #include <time.h> #include <cstring> #include "resource.h" using namespace std; const char cn[] = "SameGame"; // ClassName HBITMAP BLUEBMP …

Member Avatar for William Hemsworth
0
193
Member Avatar for DanLB

Hi all I'm new to this forum - Hope you can help me with my problem. First off all; I apologize for my poor english skills, i'm from sweeden I'm trying to make a simple phonebook by using a vector of struct's. As you can see in the code pasted …

Member Avatar for Ancient Dragon
1
527
Member Avatar for triptych2008

Hey guys. I need some help on input validation in an array. The program can only input numbers but not characters. This is the code for the input. ( I know im a newbie lol ) [code=cpp] const arraysize = 10; float num[arraysize]; for ( int i = 0; i …

Member Avatar for vijayan121
0
122
Member Avatar for nelsonsu

as the project given input1.txt and command1.txt to create result1.txt input1.txt: 1 C0A80001 8F22 C0A80002 0050 32D5B9C 2 C0A80001 8B05 C0A80002 0050 12D67B 3 C0A80001 CC08 C0A80002 0050 32D5B9C 4 5 6 C0A80001 C4A3 C0A80002 0050 34F1 command1.txt 1 output 2 output the queue length 3 idle 4 output 5 …

Member Avatar for nelsonsu
0
256
Member Avatar for ferdz13

hi to all how could I use a mathematical operation on in c++. thats always bather me because i need it in my program. pls. help me.

Member Avatar for vijayan121
0
131
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
305
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
76
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
84
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
224
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
92
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
114
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
140
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
95
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
208
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
167
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
95
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
136
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
113
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
68
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
124
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
125
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
105
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
81
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
155
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
146
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
270
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
187

The End.