49,761 Topics
| |
I am attempting to write a program that simulates a lobby or a line in which a "player" can get into in the form of a heap. The program does everything it is supposed to except when you try to add a second object("player") to the heap it won't do … | |
I have only few days to submit the project of c++ on the topic "Wordprocessor" using dev C++ IDE and gcc windows version compiler. Most of time, i had spent for reading tutorials on wx-widgets. But, now neither i could go on to complete the tutorial nor i have started … | |
What is ctypes data for BOOL? I mean in C++ to ctypes we have: int--> c_int float--> c_float what about BOOL? | |
Hello friends ........ it's ma first post. As i know, constructors are called at the time of object creation. But if i want to call it explicitly, not at time of object creation, can i do this? if yes? then how? any help please?......... | |
i'm working on a school assigment with Binary search trees im trying to find the localtion of the smallest key in the binary nodes so i created a function that retutns the point location to the smallest element key [CODE] template <typename DataType, class KeyType> BSTreeNode * BSTree<DataType, KeyType>::findMin (BSTreeNode … | |
So here is how the program should work: It should accept a string in which there is a full operation (ex. 23 + 34) it should split the string into three parts. The first and the third part should be the numbers and the second should be the operation sign. … | |
I am writing a function that inserts an item into the rear of the queue. [code=cplusplus] template <class T> void Queue<T>::pushBack(const T& item) { QNode<T>* newNode; newNode = new QNode<T>[item]; if (empty()) qFront = newNode; else qRear->next = newNode; qRear = newNode; qSize++; } [/code] It seems like line five … | |
I am using Dev-C++ in Windows. When given a file's url I want to be able to download it to a variable and then pull data out of the file using string manipulation and use it in my application. I have search Google and I have not found any good … | |
I am trying to answer some practice questions, but I really don't know what to to with the following questions. > Given the following class definitions, identify the type of class relation > ship and determine both the superclass and sublcass. class Shape {} ; class Triangle: public Shape {} … | |
I don't understand why this program will not compile please help. This is what the program supposed to do. After the correct number is guessed or all five guesses are used and the correct number is not guessed, the user will see a message that shows the secret number and … | |
how can i modify my code so it can handle upper and lower case characters.. for this: cout << "(B)uy, (S)ell, (H)old or (Q)uit: "; cin >> ans; what should i add to the code? i added #include <cctype>. | |
Hi, I wrote a program to read from one file and then process data and out put to another file, it all works okay but what I am wondering is that my source file will have a different name all the time, but it will always be the same file … | |
Yo guys plz can anyone teach me how to disable a button without using MFC. It would be great for the help | |
Hi, I'm having trouble with a program that I have to write that is supposed to convert a prefix expression to a postfix expression using stacks. The program I wrote seems to compile fine but when I run it, it gives me a fatal error and aborts the program. I'm … | |
Hello all, I have been programing for a year or two and i dont get vectors. I have seen them with numbers but can someone give me an example of vector.erase with letters? like for an RPG: like sword, axe, armor. Then have them chose what they want to be … | |
Hey. Can someone help me with this parsing function? I'm not sure why it won't work. Whenever I test it with a valid input and output file it simply crashes. [code] void parse(string infilename,string outfilename) { string temp; ifstream infile(infilename.c_str()); ofstream outfile(outfilename.c_str(), ofstream::app); if(!infile) { cerr<<"Infile Not Working!"; } if(!outfile) … | |
Ok well i need help with my code, the idea is to make something like a DOS Console, the trick is we are not alowed to use dos functions. Well this is what i have so far [code] #include <stdio.h> #include <iostream.h> #include <conio.h> #include <string.h> #include <dir.h> #include <dos.h> … | |
my homework is to make a c program displayin de cosine series.....i made up one referrin buks but can it be made simpler or somethin using while statements.......... [code=cplusplus] #include<iostream.h> #include<conio.h> #include<math.h> int fact(int);//Global defenition void main() { //cos(x) //to find the power pow(number,power); //to find root sqrt(number)-- in math.h … | |
I'm trying to write a GUI program where I want to use both strings and vectors, but the computer won't recognize them no matter where I try to include <string> and <vector>. Can you tell me where in the code I need to put my includes and my std namespace? | |
I made this program that should be very easy but it does not work. When I try to run it, it should take the price and add tax to it but it comes up with a crazy decimal number like: 7.74335e+268. What should I do I tried everything. I #include … | |
Helo frndz, I'm a nob in c++....So, I want to know about default constructor. How to create? Why default constructor? How to create a no-arg constructor that creates a default triangle??...Plz help... Thnx... | |
I know, I know, this seems like an uber beginners question and most likely is. I have had this error several times and always figured it out myself, but this time it won't. GetUserData() returns a void* [code] #ifndef BLABLA_H #define BLABLA_H #include "GameEntity.h" //class declaration left out for simplicity … | |
I am learning c++, below is an attempt at a simple XOR encryption program. I am am using Dev c++ (Blooodshed Ide) using the ming-gw win 32 gcc compiler blah blah. This code compiles without errors or warnings but it will not produce an 'exe' only a '.o' file, firstly … | |
Hello, I'm sure this is some complete beginner's 'gotcha' that I've forgotten all about but if anyone can give me a clue as to why my pointer seems to be going astray....? I'm new to C++, well, very old to C++ actually but have been programming JAVA for years and … | |
Hi, I just wonder if this is possible: (semi-pseudocode (won't work as planned)) ofstream fout("my_file.txt"); fout << cout; Looking forward to your reply | |
The following is a class diagram for class textBook and the main() program. The class consists of 3 data members and 4 function members. Write a complete C++ program that is able to do the following tasks: textBook bookName : char[] bookPrice : float totalInStock : int Constructor orderBook(int):void checkQty() … | |
i found this code online and im trying to get it to overwrite the original file instead of printing to screen but i have to admit its too advanced for me can anyone help please [code=cpp] #include <iostream> #include <fstream> #include <string> #include <vector> #include <iterator> using namespace std; int … | |
PLEASE EDIT this code if u can . this is my c++ Assgnment it is about reserving air tickets. if u can help me 2 insert delete & Edit a air ticket functions to the main menu please please please help me my friendz... I wz managed 2 save d … | |
I have a text file, for example: [code]This Is A Text File[/code] This file is on some host. Now I want to get the file to my program, my problem here is, that I found how to save the file(download) but that's not what I need.. I need it to … | |
hi folks, I have some 247 warnigs are same type warning C4996: 'fopen' was declared deprecated I am using makefile to compile my cpp program in Visual studio 2005. I have added _CRT_SECURE_NO_DEPRECATE in preprocessor definition too. but still I do get the warnings . Could anyone help me? |
The End.