49,761 Topics

Member Avatar for
Member Avatar for iTsweetie

My professor has assigned a machine problem that asks us to write a program using cin.getline, strcmp_s, and strcpy_s to get a string of words and then count how many times those words were used in the sentence. I have searched online for a solution to my problem but I'm …

Member Avatar for jencas
0
98
Member Avatar for boydale1

I have to construct a class for strings. C++ already has one, but my assignment is a home-made version. I am very lost as to how to make the constructor work. I have toyed with a few things, but I was given a header file to follow and I have …

Member Avatar for boydale1
0
118
Member Avatar for WesFox13

Hey all I have a bit of a problem, I need a little help fixing this little error problem. The Error is "error C2668: 'sqrt' : ambiguous call to overloaded function" it is on this line of code: [code=c++] void myint::square() { // Output square root cout << "The square …

Member Avatar for WesFox13
0
85
Member Avatar for arreyes

I am making a word ladder and have gotten some headway on creating a tree design but for some reason in my insertion function I am getting an error saying that this is the "first use of this function" This function being my vector<node*>"children". (I have the area marked with …

Member Avatar for arreyes
0
87
Member Avatar for Evan M

I'm having several difficulties with memory leaks in a program (I've been using "Visual Leak Detector" to check for memory leaks). I've simplified the code to the following: [code=C++]#include "vld.h" #include "vldapi.h" #include <string> #include <vector> class BaseFoo { public: BaseFoo() {} ~BaseFoo() {} }; class ButtonFoo { public: void …

Member Avatar for Evan M
0
172
Member Avatar for NavidV

Hi guys, I have a question regarding C++ classes and polymorphism. I understand the concept of pointers and that polymorphism with respect to operators(+, -, etc...) means that the operators can have different meanings based on "context" (how they are used). My question is regarding class pointers. For example, if …

Member Avatar for ArkM
0
89
Member Avatar for venkitce
Member Avatar for Froboo

Hi! I've been having some problems in getting a hold of the current selected item. All the clicking works fine, but when using the up/down arrow key problems start occuring. Lets say item 0 is marked when the user decides to unmark it. If the user then presses the down …

Member Avatar for Froboo
0
419
Member Avatar for songweaver

Hey guys, How would I make this program work without a "while" just using "if" statements. I know doing it this way is probably more efficient but there must be a way to do it with just "if" statements. Thanks! :) #include <iostream> using namespace std; int main() { int …

Member Avatar for MosaicFuneral
0
271
Member Avatar for patrik_zidane

Hello I am trying to compile libwbxml so i can convert xml to wbxml. However i am not successfull, i keep getting alot of errors (I opened up the .dsw file and tried to build it. I have no prior knowledge of either VC++ or building any C programs). I …

0
35
Member Avatar for mohsin334

Dear guys, Here I'm gonna show u how to overload different operators in c++. First of all I'm going to overload unary operator(the operator that acts on one operand) that are `++` and `--`. so lets overload the `--` with a simple example. #include<iostream> using namespace std; class school // …

Member Avatar for daviddoria
0
92
Member Avatar for superpc2525

I have made a game on c++. Can any one help me to improve it (by adding graphics) and making code short. [code] #include <iostream.h> #include <conio.h> #include <time.h> #include <dos.h> void main() { clrscr(); int i,a=21,b=0, c[5]={0,4,3,2,1},z; char x=15; cout<<"\n\n\n\n\n\t\t\t\t\t\t\tWelcome"; cout<<"\n\n\nRules:\n\n"; sleep(1); cout<<"1. There are 21 match sticks between …

Member Avatar for siddhant3s
0
285
Member Avatar for pdwivedi

hi everyone i have written a simple program which asks for the colour and no of wheels of a vehicle. i used gets() for inputting colour of vehicle.but it was skipping that line. some body suggested me that it is buffer problem and use cin.getline() with getchar() function in while …

Member Avatar for Ancient Dragon
0
199
Member Avatar for man4ish

How to make map with two kwys. I am using struct. struct Key { char * gi; char * offset; Key(const char * _gi, const char * _offset) { gi = new char [strlen(_gi) + 1]; strcpy(gi, _gi); offset = new char [strlen(_offset) + 1]; strcpy(offset, _offset); } ~Key() { …

Member Avatar for BradenMurphy
0
180
Member Avatar for daviddoria

It seems like SO often I need to attach a "valid" flag to a standard type. For example - I have a function called "CalculateLunchTime" that I pass a vector of times. If the vector has 0 elements, they did not take a lunch, so the duration is 0 minutes. …

Member Avatar for Rashakil Fol
0
588
Member Avatar for vishy_85

hi all , i need to return the value of tempdate to the main function .... any idea how i can do that ??? [code=cplusplus] #include <string.h> #include <sys/time.h> #include <time.h> #include <stdlib.h> #include <stdio.h> #include <iostream.h> char* incrementdate(int &func_days_int,char *tempdate) { char temp_dat[11],temp_mon[8],temp_year[5]; int cur_dat,cur_mon,cur_year; temp_dat[0] = tempdate[0]; temp_dat[1] …

Member Avatar for Ancient Dragon
0
132
Member Avatar for daniel_16

Hi, I am creating a hash table which is basically a pointer array of 6151 elements. I use it for chaining. But my code doesnt work properly. There's an error at T[i]=NULL and at function call. This is how it goes: [code=cplusplus] #include <iostream> #include <string> #include <vector> #include <fstream> …

Member Avatar for xyzt
0
582
Member Avatar for daino

Hi all This may seem relly naive but I'm only new to C++. If, in the future I want to build charting software for stock-charts, etc and want a very professional and portable widget toolkit to use with C++ which one should I use and what should I be looking …

Member Avatar for xyzt
0
107
Member Avatar for arshad115

i m making a program which initializes a 2d Dynamic array by first asking for the number of rows and columns,and then filling the array with random characters. Then i have to check for a three lettered array in the 2D array,(Horizontally,Vertically,Diagonally). i m having problem with the conditions for …

Member Avatar for arshad115
0
250
Member Avatar for rekhamanoj

can anyone please suggest me any library or programming method to plot contour of a surface using its x,y and elevation. Thanks in advance

0
64
Member Avatar for VRspace4

Hello, I'm writing a simple C# connectionless UDP application that communicates with a C++ connectionless UDP app. I could send from the C# to C++ using the following sets of functions fine: Send from C# to C++ C#: SendTo() C++: recvfrom() However, I'm having trouble receiving the C++ UDP messages …

Member Avatar for LizR
0
723
Member Avatar for tasneemnikhat

hey ol, i dnt hav much time left to solve des Q's.. can u plz guide me solving des... Fundamental Exercise /* class design, dynamic memory allocation and operator overloading */ 1. Write a program to implement Matrix class. • Implement addition and multiplication operation • row and col of …

Member Avatar for tasneemnikhat
0
119
Member Avatar for nosnibor

Ok is there any why i can call the base class this pointer or object from with in a derived class? Example: [CODE=cplusplus] class BASE { public: BASE () {} BASE(BASE & b){} virtual ~BASE () {} virtual void Method(){cout << "BASE::Method called"; return; } }; class DERIVED: public BASE …

Member Avatar for vicky_dev
0
1K
Member Avatar for nnhamane

I am using RDLC and i want to add dynamic text in header as well as in footer and some images in to the header but i cant understand how to add it in same rdlc. i can add static text in header as well as footer and when i …

0
59
Member Avatar for monolith45

Hi there! I have written a program with fixed costs for a vacation. I need to add sales tax in for the total amount but this needs to be floating. Also, I had intended this to be a user input based program, but without knowing the float code for calculation, …

Member Avatar for vmanes
0
141
Member Avatar for Duki

Hey guys, I'm getting an error at lines #9 and #14. Could someone tell me what I'm doing wrong? [code=c++]StackType::StackType(const StackType & st) // copy c-tor { if ( st.topPtr == NULL ) topPtr = NULL; else { NodeType * stptr; // pointer to source Stack NodeType * p; // …

Member Avatar for Duki
0
177
Member Avatar for chiurox

Hi, I'm writing this code where I want to match a string with a signature. A wildcard '?' would mean it can skip 1 character. A wildcard '*' means it can skip 0 to 32 characters. For example, say I have: string "screwed" and a signature "screw?d" These two would …

Member Avatar for Ancient Dragon
0
454
Member Avatar for leestotch

Hey friends, Started c++ not to logn ago and took right to it, up until now I have had no problems whatsoever. Now, with my specific assignment I have absolutely no idea what do to. I dont even know where to begin. I feel foolish and embarrassed and I'll i …

Member Avatar for VernonDozier
0
117
Member Avatar for Akhilleus

I'm having a hideous problem with a program I'm working on involving a map with pointer keys. The keys are pointers (to objects on the stack) and the data are pointers (to objects on the heap). It's the list of references for a handle class, so that if handle.destroy() is …

Member Avatar for Akhilleus
0
184
Member Avatar for Gagless

I have to write a program that outputs the length and width of a rectangle and then calculates and outputs the area, using a class called rectangle... I thought I was about done, but when I run the program it says width, length and area are being used without being …

Member Avatar for Gagless
0
130

The End.