49,761 Topics
| |
[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 … | |
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 … | |
[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. … | |
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 … | |
[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, … | |
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 ... | |
Here is a quick question that should be easy to answer. Is there a cubed root function in the C++ library? | |
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 … | |
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, … | |
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 … | |
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 … | |
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, … | |
[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, … | |
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> … | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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. … | |
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 … | |
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? :?: | |
Greeting , it will be helpful if any one can provide me with Round Robin algorithm code in c/c++ thanks in-advance | |
can any one provide me with the round robin algorithm code in c/c++ hurry up!!! | |
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, … | |
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 … | |
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 … |
The End.