51,593 Topics

Member Avatar for
Member Avatar for apcxpc

It's easy enough in Java. How is it done in C++? for e.g. I have a class called Relation, that has a name field (just a string) and then a vector of strings. I want to specify that wherever I type (for example): Relation* r = new Relation(...); cout << …

Member Avatar for Narue
0
3K
Member Avatar for some one

please help me to write this program Ihave make one closed to it but I could not do it as what it says here is the problem and my solution: This is the program Write a program that outputs a telephone bill, given information on telephone calls made by the …

Member Avatar for Narue
0
246
Member Avatar for SquirrelProdigy

Here soon, I was hoping to buy an IDE for C++. However, I'm not sure which is the best to buy. I only know of Borland and Microsoft's as popular IDEs. Are there any other popular IDE's that are worth purchasing. I'll be heading off to college here soon, and …

Member Avatar for Narue
0
183
Member Avatar for kittie

[code]//final.cpp //Creates an array with 2 players' batting avg //Read in hits and atbats for each player //1) one player get data in main //2) other get data in battingavg function //battingavg function figures out battingavg for both players // and puts them in array (not hits & abats), print …

Member Avatar for Narue
0
179
Member Avatar for souphmars

can yall help me-i need to be able to output in preorder (root, left, right) and in post order (left, right, root)- when i output now it is in order (left, root, right)- how come it does this automatically, just wondering about that-but i need help with preorder and postorder, …

Member Avatar for Sarburtho
0
162
Member Avatar for b.rajapandian

Hi everybody I am asked to develop a search utility in C++. That should search words inside files like pdf, chm, word, excel and txt. The user will provide the directory to be searched and some keywords. Based on the keywords, I have to search these files for the keywords. …

0
73
Member Avatar for Acidburn

[code] int hangman::checkstatus() { for ( int i = 0; i < 5; i++ ) { if (encryption[i] == '*' ) { return i; cout << i; break; } } if ( i == 4 ) { cout<<"You win!"<<endl; } return 0; } [/code] Hello guys, this function always returns …

Member Avatar for Dave Sinkula
0
185
Member Avatar for raghavendrak

Hi Friends, I want to write a MP3 player with minimum GUI for Linux (Fedora) I dont know where to start with I have knowledge of C/C++ programming, but not much knowledge of creating a GUI. I use Eclipse. I want to write for KDE. Can you please guide me …

Member Avatar for subtronic
0
277
Member Avatar for SquirrelProdigy

[CODE]if(cmd=="new"){ string name,desc; cout<<"Name? "; cin>>name; Setcursor(Conloc); cout<<"Desc? "; cin>>desc; Setcursor(Bodyloc); Invitem Item(name,desc);[/CODE] When the values of the string desc is set through cin, if a space is used, all text after that space isn't used. Also, If two words are used when setting name, it will give the second …

Member Avatar for subtronic
0
272
Member Avatar for winbatch

Hi, I'm trying to use the STL map class to be able to store keys and associated values. I started out using it with keys of pre-existing data types like int, string, etc. and was working fine. I was also able to use it with values of custom classes. I'm …

Member Avatar for Narue
0
452
Member Avatar for kittie

[code]//project.cpp compiles //Need to create an input file of recently shipped music CD's. //The file should consist of the name of the album, quantity shipped and price. // Since we do not know how many CD's have been shipped, keep reading the file //until all CD's have been read in. …

Member Avatar for alc6379
0
232
Member Avatar for silicon

Hello everyone, my code is finally complete thanks to all of your help. One questions I have is regarding the reslts. I thought that Merge was faster than a heap sort. In my results however (when run on Borland c++) Heap comes out with a faster sorting time. The functions …

Member Avatar for subtronic
0
176
Member Avatar for bsrivastava

[I][COLOR=Red]Moderator edit: This response and its replies have been split from the C and C++ Timesaving Tips sticky because they do not add relevant material, and they are long enough to distract from the intended purpose of the thread. Further replies on this topic may be posted in this thread, …

Member Avatar for Narue
0
221
Member Avatar for hasan2003

hi, can any one tell me where can i get a idl compiler? i know about [B]idlc[/B] but i cant find any link ... help please ...

0
100
Member Avatar for the b

Here is a quick question that should be easy to answer. Is there a cubed root function in the C++ library?

Member Avatar for Narue
0
217
Member Avatar for winbatch

As seen in another thread, I'm working on a Log class. I'm running into an issue that if I delete the file that's being written to, the Log class doesn't detect it and continues to 'think' it's writing even though the file is gone... (Note that this is on sun …

Member Avatar for subtronic
0
2K
Member Avatar for nizar4445

hello all can any body help me to correct this code please :cry: :cry: i want it so it can print whats n is in these different cases. this is my code and thanks alot for your help #include <stdio.h> #include <iostream.h> #include <stdlib.h> void main() { int ave, 1st, …

Member Avatar for sinrtb
0
307
Member Avatar for Raza

im going to make an operating system...after completing my boot and kernel work....not i have just created a simple c++ program for my os....now i wan to convert that c++ .cpp into .bin so i can write it into floppy sector...bcoz my os will be base on floppy disk... question …

Member Avatar for subtronic
0
140
Member Avatar for Brent_Ritterbec

I am working through the book Visual C#.NET Step by Step, and I came to the section of the book where the author shows how to create comments on your code with XML. ///<summary> ///The obligatory Hello World in C# ///</summary> ///<remarks> ///This program writes out Hello World ///using the …

Member Avatar for casmith
0
150
Member Avatar for Digital Reaver

I need help writing this program i have everthing set up except i cannot get the program to save the output from it. Here is a copy of my work (It will most likely suck Im new at this sorry.) Any help will be very appreciated. I need the file …

Member Avatar for winbatch
0
110
Member Avatar for bl4ckch3rry

Hi, i searched around and couldn't find any examples on what i'm looking for.. Im a newbie when it comes to Winsock (C++) and im not sure what im doing wrong, if you could just point me in the right direction or provide some source code that'd be very helpfull, …

0
152
Member Avatar for kittie

[code] //project.cpp //compile error-price undeclared (first use this function) #include <iostream> //don't I have it declared in the float line?? #include <fstream.h> #include <stdlib.h> using namespace std; int main() //PROBLEM: Create an input file of recently shipped music CD's. The file should consist of // the name of the album, …

Member Avatar for kittie
0
211
Member Avatar for bobr_1013

When this program runs, I can enter in the name the first time through the while loop (using "cin.getline). When I go through the second time, it skips the name and asks to enter the ss#. The first time through, everything works fine. [code] #include <iomanip> #include <iostream> #include <fstream> …

Member Avatar for vegaseat
0
232
Member Avatar for rohitmc

hi i am new to this forum and my major is computer science...this is the best thing i found on the web yet....i will try to help you out anyway i can.....i need help on this program...thanks 1. create a dynamicarray to hold the first 10 odd intergers. now create …

Member Avatar for rohitmc
0
203
Member Avatar for hessa

Hi, This program supposed to ask the user to enter the names and the ID numbers and the number of children the employee have, the search shoud work like this taylar 845 3 john 123 2 sara 526 2 **search by name** the user should enter the employee name he's …

Member Avatar for hessa
0
241
Member Avatar for subtronic

These two languages, for the most part, are completely different; especially now. From culture to paradigm. So let's get a seperate C forum going.

Member Avatar for subtronic
0
296
Member Avatar for tgreer

Since nobody answered the thread on Binary File IO, I took a different approach. Now I'm having another problem. As I process a very large (>2GB) binary file, I store the byte position at certain points. Then, I reposition the file as needed. I store the byte positions in a …

Member Avatar for alpha_foobar
0
359
Member Avatar for nathanj99

HI. Hopefully I can resolve this now with your help. simply, I want to write a String to file. I have been trying it with fstream. The string comes in the form of AnsiString from a c++ Edit component. Can someone provide some code to do this. Since I cannot …

Member Avatar for Narue
0
311
Member Avatar for peter_budo

Studying Computer Science on Unix platform is ussually fun expect days when you get stuck. And life get [B]tough[/B], this is one of my tough days. To make life easier with my c++ programming I wanted to use the [B]make[/B] tool under unix. I have 5 fieles : - student.h …

Member Avatar for peter_budo
0
216
Member Avatar for Rose Aashii

Hye. i write this code to get inpur from user such as ram and hard disk capacity as integer type using structures. After that i want to create a file in which i want to save that data. In the code below it is getting input from user but not …

Member Avatar for alc6379
0
145
Member Avatar for nathanj99

HI I am trying to write and read to file. I am experimenting with a small piece of code before going onto my main program. I am simply trying to write a float variable and a String variable to file using fstream. The variables are float version; Edit1->Text (this is …

Member Avatar for Narue
0
160
Member Avatar for Acidburn

[php]#include <iostream> using namespace std; class Wheel { public: Wheel(int size); int getDiameter(); protected: int diameter; }; Wheel::Wheel(int size) { diameter = size; } int Wheel::getDiameter() { return diameter; } class Bike : public Wheel { public: Bike(int f, int b); int getFrontsize(); int getBacksize(); bool operator==(Bike ); private: Wheel …

Member Avatar for Narue
0
198
Member Avatar for mindsvelte

Hi, I'm new here and wanting to learn C++ to a professional standard. I've been a programmer for 20 odd years mainly on mainframes using COBOL, Easytrieve, JCL etc, assembler and Databases. So some of you guys may appreciate that I like to see the code that does the manipulation. …

0
84
Member Avatar for nathanj99

Hi, I really need some help. I need to write a structure to disk in c++ builder. I have been trying now for a couple of weeks and I am now about to give up. I have tried fread,fwrite etc. fstream as well as TFileStream with no luck. I have …

Member Avatar for Narue
0
212
Member Avatar for phredi++

i have written a console application in c using borland c++. i want to include mouse capabilities in the program ie. run the program using the mouse just like in norton disk doctor(dos-based version). any help? :?:

Member Avatar for phredi++
0
219
Member Avatar for feda

Greeting , it will be helpful if any one can provide me with Round Robin algorithm code in c/c++ thanks in-advance

Member Avatar for Narue
0
194
Member Avatar for apurva agarwal
Member Avatar for Narue
0
338
Member Avatar for tat2dlady

Can anyone tell me why this is printing doubles out to the output file? [CODE] IndexFile.seekp(20, ios::beg); for (i = 0; i < NumOfSlots; i++) { if (RandomFile.peek() == 42) { Position = i; RandomFile.seekg(37, ios::cur); //cout << Position << " "; } else if (RandomFile.peek() != 42) { RandomFile.get(R.SSN, …

Member Avatar for tyczj
0
224
Member Avatar for Rose Aashii

I write the folowing code which is taking RAM and Hard disk capacity from user by using structures and than saving it to a new file after the user complete entring data it is displaying data entered by the user by opening that file. Problm is that i want to …

Member Avatar for Narue
0
160
Member Avatar for Tlhokomelo

Hello, I am new to the oop enviroment and I am more interested in using c/c++ but I can not afford to buy books on the subject. I would be extremly grateful to any one or group that can send me some c/c++ material of sort. Or tell me of …

Member Avatar for Narue
0
146
Member Avatar for silicon

Hello again everyone. We have completed a project after a few months and a lot of help but for some reason we are still having problems. The project compiles properly without errors but the results are incorrect. Basically we are using 4 sorting algorithms in order to calculate how much …

Member Avatar for Narue
0
117
Member Avatar for XxAndyxX

I have a project where I must use pointers to do a search on some accounts I've built up into a vector. My problem is whenever I try to pass the vector to a pointer I get an error. I've tried many different things but to no avail. Maybe one …

Member Avatar for Dave Sinkula
0
219
Member Avatar for MrNiceGuy82

I need a little assistance with finding the square roots of each number entered by the user in a array. I'll copy and paste what i have so far in my function, but i get an error when i try to run the program and it would say: sqrt was …

Member Avatar for Narue
0
2K
Member Avatar for Dave Sinkula

Suggestion: I like the language tags [url=http://www.gidforums.com/t-689.html]here[/url]. I've also seen them on cpp-home. Is something like this already on any wish list for Daniweb?

0
125
Member Avatar for rharvison

I need to insert a control-break in an array after every third line. Can someone help with this? Thanks so much. -R

Member Avatar for Dave Sinkula
0
242
Member Avatar for AhmedHan

I want to change cursor position in my C++ program. As you know, C++ does not have any command to do this. By I think, one of the h files can be used for this purpose. My Bloodshed compiler has lots of "*.h" files. But I don't know how to …

Member Avatar for Dave Sinkula
0
4K
Member Avatar for pink

I want to write a program.This program is following: The two text file named file1and file2 each hold number of English sentences.A c++ program is required to carry out the following operations. a.)Give a wrod ,it lists how many times that word appears in file1 and file2. b.)list all the …

Member Avatar for prog-bman
0
97
Member Avatar for jeymine

Hi Guys, Kindly help me Solve this. I have already worked on the classes that were inherited and attached after the question is the main part of my program. I have bolded the part in the question below where I need help. Thank you so much. The question is: Make …

Member Avatar for marinme
0
179
Member Avatar for jaeSun

ok, call me stupid, maybe i forgot my math: but if a C++ program spits out this: -bash-2.05b$ g++ markoff.cpp -bash-2.05b$ ./a.out x = 1 y = 1 z = 2 x = 1 y = 2 z = 5 x = 2 y = 5 z = 29 x …

Member Avatar for jaeSun
0
469
Member Avatar for mdbrock7

I am a complete newbie in C++ programming. After a very basic introductory class I am now reading a little more advanced book and trying to teach myself and I am slowly learning. Anyway, the book mentions a method for calculating the cube root of a number but it doesn't …

Member Avatar for mdbrock7
0
417

The End.