49,761 Topics

Member Avatar for
Member Avatar for existinglady

Hello everyone, my classmate is making a library manager program and he was able to read the items on the txt file, however when we run his program a couple of times it did not read the txt file again can someone help us with this? #include <iostream> #include <string> …

Member Avatar for Ancient Dragon
0
213
Member Avatar for Jared1337

Hello daniweb people! I'm having a few issues with this triangle program. We're supposed to make a few different triangle shapes, including the two i have in this. The first triangle works, but the second triangle displays xxxxxxxxxxxxxxx times infinity. Any ideas on what i'm doing wrong? And another question, …

Member Avatar for piyush3dxyz
0
351
Member Avatar for triumphost

Well I like to learn as much code as I can in a day and I just came across the copy constructor. I do not understand when I need to use it. Do I need to use it for every class I make? I came across it after getting the …

Member Avatar for triumphost
0
275
Member Avatar for alsz

Hi everyone I am writing a program to sort an array, but I have a problem removing the duplicates ... so can someone please point me to the right direction or show me a sample program based on my code. for example, the user gives in a row the following …

Member Avatar for VernonDozier
0
329
Member Avatar for dyl_ham

This is a school assignment. I have to write a function in my program that opens a file stream and returns a heaped value to the main function. I believe the file opening function works but after it passes the ifstream pointer to the main function, I'm having trouble dereferencing …

Member Avatar for dyl_ham
0
1K
Member Avatar for new_developer

Hi, I want to know how to concatenate numbers in C++. int a = 4; int b = 5; int c = a+b; I have tried this but this give me sum of int a and b. I want 4 and 5 concatenate in c variable and give me out …

Member Avatar for TrustyTony
0
14K
Member Avatar for sampsont

I want to re-use a vector<short> over and over in a performance critical loop. I only need the vector **size** to be reset to zero at the end of the loop. I'm worried that the myVector.clear() takes time to actually clear all the memory. Also, does the myVector.reserve() survive the …

Member Avatar for sampsont
0
685
Member Avatar for MrEARTHSHAcKER

Hi, I have simple question: how do I make Windows Media Player in BorlandC++ ( an ActiveX component ) plays all songs from specified folder? Thanks.

0
128
Member Avatar for existinglady

is it possible to get this sample word : name name to be cin'ed without using getline? if not how can I achieve it?

Member Avatar for Moschops
0
69
Member Avatar for reenarankawat

/* Reena Rankawat Q89.Write a program to illustrate overloading of comma operator(,). */ #include<iostream.h> #include<conio.h> //using namespace std; class loc { private: int longitude,latitude; public: loc(void) { } loc(int lg,int lat) { longitude=lg; latitude=lat; } void show(void) { cout<<"\n Latitude: "<<latitude; cout<<"\n Longitude: "<<longitude; } loc operator +(loc obj2); loc …

Member Avatar for Rashakil Fol
0
167
Member Avatar for Albino

Errors: 1>main.cpp(9): error C2143: syntax error : missing ')' before 'constant' 1>main.cpp(9): error C2143: syntax error : missing ';' before 'constant' 1>main.cpp(9): error C2059: syntax error : ')' 1>main.cpp(63): error C2660: 'checker' : function does not take 9 arguments 1>main.cpp(71): error C2143: syntax error : missing ')' before 'constant' 1>main.cpp(71): …

Member Avatar for Albino
0
332
Member Avatar for SAM2012

Hi, I need help in designing a function that would model the arrival of the messages in the queue following poisson distribution. I shall be grateful for this kind help.

Member Avatar for SAM2012
0
178
Member Avatar for triumphost

Yesterday I took a dive into smart pointers and wasn't sure when I should use them vs. Raw pointers. I found out they are quite useful but they do not work all the time for me. Example of working: char* Buffer = new char[1024]; fread(buffer, 1, sizeof(buffer), infile); //took out …

Member Avatar for mike_2000_17
0
227
Member Avatar for merse

Wats wrong with this? std::vector<std::set<unsigned long> > surroundings; std::set<unsigned long> empty (); X = std::vector<std::set<unsigned long> > (N,empty); (where N is an ulong)

Member Avatar for mike_2000_17
0
169
Member Avatar for dancks

Background, I want to install allegro on the iMac 10.6.8 after my macbook crapped out. It didn't compilers installed whatsoever, so I had to find Xcode at a seedy 3rd party site because apple no longer supports Xcode for 10.6. It came as a binary, simple install didn't give me …

Member Avatar for dancks
0
220
Member Avatar for reenarankawat

/* Reena Rankawat */ #include<iostream.h> #include<conio.h> void main(void) { char name[50],ch[11]; int x; clrscr(); do { x=0; cout<<"\n Welcome to KBC"; cout<<"\n\n Enter your name: "; cin>>name; cout<<"\n Enter answer in form of 'a','b' and'c'only."; cout<<"\n Q1.What is called as ' THE HOLY LAND'?"; cout<<"\n a.Jerusalem"; cout<<"\n b.Mathura"; cout<<"\n c.Mecca"; …

Member Avatar for Schol-R-LEA
0
6K
Member Avatar for tomtetlaw

I appolagise for the slightly ambiguous title, I didn't know what to call it. I want to create a way to define interfaces without having to also write the class declaration that implements it. I have the class members, and the interface defined, but I am not sure how (if …

Member Avatar for tomtetlaw
0
164
Member Avatar for icefreezer7

Hi I started graphics programming only recently so im still a beginner at it. I've tried a snippet from online for c++ and I always get the same error message, Cannot open include file: 'stdafx.h': No such file, please help because Ive looked around this forum and I cant understand …

Member Avatar for Lucaci Andrew
0
414
Member Avatar for 330xi

Hi! I have a Moniker from ROT and I have an "empty" _ApplicationPtr variable. How Can I have in _ApplicationPtr var a process by Moniker.

Member Avatar for 330xi
0
76
Member Avatar for Sendy Hipo

hi, i have problems with static member function the compiler's problems = "undefined reference" **Design a class Numbers that can be used to translate whole dollar amounts in the range 0 through 9999 into an English description of the number. For example, the number 713 would be translated into the …

Member Avatar for Sendy Hipo
0
697
Member Avatar for nuclear

I'm using the Guichan lib and I was trying to run the "First application with Guichan, OpenGL and SDL" example, which is located here [Click Here](http://guichan.sourceforge.net/oldsite/getting-started.shtml) . Everything was fine exept when I exit the program and delete all the pointers which were allocated with the "new" and because of …

Member Avatar for Lucaci Andrew
0
160
Member Avatar for toluwanimibosun

could you help write a c++ program da allows 10 players to play the game of dice and displaying the winner with highest score

Member Avatar for Lucaci Andrew
0
113
Member Avatar for poloblue

Good Afternoon, I'm having trouble with loops that deal with enumeration. So far I have this code #include <iostream> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <cstdlib> #include <iomanip> using namespace std; int main( ) { //enumerate type definition enum weekDays {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday,Sunday}; //variable …

Member Avatar for Lucaci Andrew
0
298
Member Avatar for triumphost

Why does this say shaddowing? If I change my member X and Y to `_X, _Y` then when I access my class via the dot operator, it shows FOUR values.. Current Class: class Point { public: int X, Y; Point(int X, int Y); ~Point(); }; Point::Point(int X, int Y) : …

Member Avatar for triumphost
0
124
Member Avatar for JE821

So the program makes an inventory from a cvs file. The cvs file consists of dvds and books. here is the code: #include "StdAfx.h" #define _CRTDBG_MAP_ALLOC //for memory checking #include <iostream> #include <stdlib.h> #include <crtdbg.h> #include <iomanip> #include <fstream> #include <string.h> #pragma warning(disable: 4996 4018) using namespace std; #define COPYSTR(TARGET, …

Member Avatar for JE821
0
372
Member Avatar for triumphost

I'm trying to figure out why I should convert all my unsigned ints/shorts to size_t. I'm doing the things below but I'm not sure which one to use and which type to iterator my for-loop with: unsigned short Size() { return vector.size(); } int Size() { return vector.size(); } unsigned …

Member Avatar for triumphost
0
197
Member Avatar for valestrom

I can't figure out how to convert my int value back to a string for use in a textbox. I already pulled it out converted it to int, did the equation now I just want to flip it back to display in a textbox. private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) …

Member Avatar for valestrom
0
3K
Member Avatar for XodoX

How many lines will the following codes print out, and why? main() { fork(); printf ("Hello!\n") fork(); printf("Good Bye!\n"); } // main What's the fork() doing here? Does it change the number of lines that will be output? > > The purpose of fork() system call is to create a …

Member Avatar for Lucaci Andrew
0
253
Member Avatar for triumphost

Currently I'm reading Multi-String values from the registry. These strings are double null terminated and single null delimiters are between each one. So below I have the following where these are declared as so: std::string KeyToRead, Result; DWORD KeyType. Now I'm returning an std::string aka Result. So I iterated my …

Member Avatar for triumphost
0
456
Member Avatar for schlulol

Hi, I've been working on a c++ game of connect 4. It uses a multidimensional array, and I have a function that is capable of checking if someone has won. However, ai is really bugging me. I've tried to do some research on this minimax thing, but I couldn't find …

Member Avatar for m4ster_r0shi
0
312

The End.