49,757 Topics

Member Avatar for
Member Avatar for lolsh

hi i have this question..i solved it but im not sure if its true or not.. template<class t> class c { private: int size; t *p; public: void set(int sv) { if(p!=0) {delete[] p;} p=new t[sv]; for (int i=0;i<sv;i++) cin>>p[i]; } c() { size=0; p=0; } the question is that …

Member Avatar for jonsca
0
102
Member Avatar for LevyDee

So is it worth learning win32 API instead of just shooting straight to Microsoft Foundation Classes? One of my classes covered win32 for a little and I was able to do a couple fun things with it, but then we jumped into MFC. It makes you ask the question, is …

Member Avatar for LevyDee
0
101
Member Avatar for red999

I implemented a BFS on a maze that I made, but the one problem that I have is that I do not know how to obtain the indices of the path that it took to solve the maze. Right now all my BFS algorithm does it prints out if it …

Member Avatar for WaltP
0
157
Member Avatar for aliirooni

hi, i have an error in my syntax where define operator +() . compiler says "declaration syntax error" i have. what is my fault!? [code=c] #include<iostream.h> class exforsys{ private: int x,y; public: exforsys(){x=0; y=0;} void getvalue(){ cout<<"\n enter value for x:"; cin>>x; cout<<"\n enter value for y:"; cin>>y; } void …

Member Avatar for Salem
0
130
Member Avatar for CarleneGriffith

I am having a problem with my code. below i have outlined the home work requirement. please take a look at the second part(this is the code that i have written) I keep getting an error when i try to run the code. The error states:The program '[3716] Lab02 Case01.exe: …

Member Avatar for WaltP
0
110
Member Avatar for robski

Hi everyone. Could someone please help me with this. I have a program which i have written and finished for a college assignment. It is completely done. I have a perfect working copy on my laptop but when i copy it to usb stick and take it to college it …

Member Avatar for WaltP
0
218
Member Avatar for dylan9

Hey guys, this is my first time posting. I'm almost done with the whole program but the only problem left is the word frequency counter. I have file(.txt) that the program reads on and it outputs the words aphabetically and if the word has been seen, it adds a count …

Member Avatar for abhimanipal
0
2K
Member Avatar for cgalvani

The two classes from the Queueclass5.cpp program are displayed below. Please add another method which will search the Queue for a name which is supplied in its parameter and will return a Boolean value of true if the name is found, or false if not. The method will have the …

Member Avatar for mitrmkar
0
104
Member Avatar for fk5122003

code file is attached .... [CODE][#include<iostream> using namespace std; class citizen{ char* name; char* nationality; public: citizen(){ //default constructor name = "Usman"; nationality = "pakistani"; } citizen(char *aName, char *aNationality) //parameterized constructur { name = new char[strlen(aName, aNationality)+1]; strcpy(name, aName); strcpy(nationality, aNationality); } citizen(const citizen &obj){ //copy constructor name = …

Member Avatar for Ancient Dragon
0
100
Member Avatar for h3llboss

I want to look for letters of a string and then look-up in the alphabet and then write the index number of alphabet array's index . Like; A=0 B=1 etc. c=2 z=25 [CODE]# #include "stdafx.h" # #include "time.h" # #include "stdio.h" # #include "string.h" # #include "stdlib.h" # # #define …

Member Avatar for Ancient Dragon
0
89
Member Avatar for gilanisyed

i have a question that in 2-3-4 tree ,how 4 state tree or 4 node tree is created.mean that how to insert first 3 data till the nodes are split.can anyone tell me please. Thanku so much.

Member Avatar for Salem
0
46
Member Avatar for nola_Coder

I want to implement a countdown timer in a game, but need some help figuring out how to do it properly. I know that this is probably a very regular question that has been asked a thousand times, but I've been trying out some methods I found through searching, but …

Member Avatar for VernonDozier
0
154
Member Avatar for emybob

im trying to create a class that will create a 20x20 grid with 5 random x's and 100 random o's. But its currently giving me ascii chars instead. any help would be appreciated! [CODE]#include "Lifegrid.h" using namespace std; int main() { int r1; int r2; int r3; int oldi; int …

Member Avatar for emybob
0
120
Member Avatar for ganno

I have to implement a simple infinite sum which estimates the value of PI. The more iterations of the infinite sum, the more accurate the value of PI. Using the equation PI=4x(1-1/3+1/5-1/7+1/9-1/11+1/13-....) .The details of the program are as follows: 1. The program must have a small menu for the …

Member Avatar for ganno
0
100
Member Avatar for sgriffin

Hey, right now I am working on implementing a matrix class for an assignment. I am using vectors in order to implement it and am having some trouble with adding matrices together. In my private I have defined: int nRows, nCols; vector<int> data; Here is my code for the operator+; …

Member Avatar for sgriffin
0
105
Member Avatar for gabryprof

[B]Moderator note:[/B] Originally posted in [url]http://www.daniweb.com/forums/thread269720.html[/url] How can I retrieve the handle of a Windows Form texBox? The property textBox->Handle is not the same thing. [QUOTE=strmstn;1167223]Winapi, if there is a window (hwnd) that has a child Edit control with ID 1: [CODE]HWND hwnd_edit = GetDlgItem(hwnd, 1); size_t len = GetWindowTextLength(hwnd_edit); …

0
62
Member Avatar for fk5122003

#include<iostream> using namespace std; class citizen{ char* name; char* nationality; public: citizen(){ name="Usman"; nationality="pakistani"; } citizen(char * aName, char * aNationality) { name = new char[strlen(aName, aNationality)+1]; strcpy(name,aName); strcpy(nationality,aNationality); } citizen(const citizen &obj){ name = obj.name; nationality =obj.nationality; } void showName(){ cout<<name<<endl; } ~citizen() { delete[]name; } }; int main() …

Member Avatar for Banfa
0
105
Member Avatar for PcCopat
Member Avatar for kenny21

You have to write a program which takes 30 integers representing collection of coins. Each integer represents worth of each coin. The program should also take another input “amount” whose change needs to be found. Your program should be finding the change using minimum number of coins. If change is …

Member Avatar for peter_budo
0
159
Member Avatar for ms.aman

i got an error mesg (`undefine symbol _ main in c0.asm`) plz find and correct the error i need it urgently plx help me #include <iostream.h> #include <iomanip.h> #include <string.h> #include <stdlib.h> #include <stdio.h> #include <fstream.h> #ifndef ADDRESSBOOK_H #define ADDRESSBOOK_H void main() { class AddressBook { protected: int recordID; char …

Member Avatar for Banfa
0
154
Member Avatar for vroommm

the problem is- it is required to store 'big integers'(more than alloted space for integers), suggest a suitable method by which big integers can be stored , also device an algorithm for adding of such numbers.. the just need the method of achieving this.i can write the code in any …

Member Avatar for Banfa
0
73
Member Avatar for Valter Henrique

Hi everyone, i'm new in DaniWeb, so forgive me by some mistake, x) I need create a iterator, it can receive any kind of struct of STL, like map, vector, list, ... How i do that? Someone have any idea? Thanks by your attention. Best regards, Valter Henrique.

Member Avatar for Valter Henrique
0
103
Member Avatar for Tonyd71

I'm a newborn to programming and my instructor has thrown me to the wolves. I'm trying to compile this simple program but I get these syntax errors. 1>y:\d03423388\desktop\projct3\projct3\prjct3.cpp(16) : error C2059: syntax error : '<<' What do I do with '<<' ?

Member Avatar for JohnKSmith
0
81
Member Avatar for spursfan2110

#include<iostream> #include<string> #include <ctime> using namespace std; class Dog { protected: string name; char gender; public: Dog(string theName, char theGender) /*constructor*/ { name = theName; gender = theGender; } ~Dog() { cout << "good bye: " << name << endl; } void bark(int n) { cout << name << ":"; …

Member Avatar for JohnKSmith
0
88
Member Avatar for Natique

Ok I'm trying to make a GUI with multiple forms on Visual C++ 2005 Express Edition. And I was following a tutorial and made two forms. Form1 and Second. I want the Second form to open from Form1. So I included Second.h in form1 and then added this to the …

Member Avatar for peter_budo
0
241
Member Avatar for nola_Coder

I'm creating a simple platform scroller using C++ and the Allegro library, and also .fmp maps created using the tile-based editor Mappy. I have two maps created, which will serve as my two levels. Once the first map is run through, I want to switch to the second map. What's …

Member Avatar for Salem
0
170
Member Avatar for stevendavis84

Employee.h [code]// Base class. #ifndef EMPLOYEE_H #define EMPLOYEE_H #include "stdafx.h" #include <cstring> // Constant for the name's default size const int DEFAULT_SIZE = 51; class Employee { private: char *name; // The name double empNum; // The employee number int hireDate; // Number of hire date on hand // Private …

Member Avatar for abhimanipal
0
368
Member Avatar for faceguy1

Hello, I am a novice programmer in C++. I know only basic object-oriented ideas and my teacher thinks it is the worst thing that ever happened to mankind and because of that, I only know procedural programming. In addition, he has us use archaic compilers such as CodeWarrior from 10 …

Member Avatar for Ancient Dragon
0
118
Member Avatar for sah15

Hi, I'm supposed to create a program where I want to purchase tickets to a theater based on rows and columns of the seats. The program uses two-dimensional arrays and constructors, and is supposed to display somethine like this: "ASU Gammage Theater 1. View available seats 2. Request tickets 3. …

Member Avatar for Lerner
0
232
Member Avatar for fellixombc

Alright, so, I decided to write an IRC Bot in C++ to get used to socket programming. Everything went fine of course, but I have one bug: when the server sends me a PRIVMSG (a message sent by a user to the server, then comes to me) it prints a …

Member Avatar for fellixombc
0
259

The End.