49,757 Topics

Member Avatar for
Member Avatar for rhn94

Hey guys. I'm trying to create a program which adds, searches & removes items from an array & i've been messing around with the code, trying to find answers on the internet but so far no dice. Could any of you help out? [CODE] void removeString(List& s, string strKey, const …

Member Avatar for rhn94
0
191
Member Avatar for pendo826

Hey i have no idea whats goin wrong with this i think its to do with the fact that its in private but i have an error with calling weapon in the monster class (Monster.cpp) the error states that it is inaccessable :S here is my code: [CODE] //Monster.h #ifndef …

Member Avatar for pendo826
0
127
Member Avatar for Rubinder singh

[CODE]void inorder(struct node *r) { if(r!=NULL) { inorder(r->left); printf("\t %d",r->data); inorder(r->right); } }[/CODE] in the above code when the last element is reached i.e r->left becomes null then when inorder(r->left) is called it will send a null value to the function and if condition becomes false so the it'll come …

Member Avatar for mikrosfoititis
1
166
Member Avatar for jackly94

Can some one help with this please. I need to update a Passengers Name, im using Strings not Char. [CODE] if (choice == 2) // Updates Record.. { merge_sort(0,N_PASSENGER-1); cout << "\n\t Enter the Seat Number:"; cin >> key k=binarySearch(passenger, 0, N_PASSENGER, key); // Search Array if(k>=0) cout << " …

Member Avatar for jackly94
0
95
Member Avatar for riahc3

Hey Im currently working on a application server written in Java but to use information from a C++ program. The company seems to agree that rewriting thousands of lines of code would be time consuming and simply making libraries of key functions of the C++ program and then passing them …

Member Avatar for riahc3
0
2K
Member Avatar for izh

Hello, I joined here desperately asking for your help I have an assignment about creating a program that loads a text file given. the text file contains many lines and those lines are questions and answers it is on this sequence question answer question answer and so on so we …

Member Avatar for izh
0
246
Member Avatar for Jackk123

Soo last year, if im not mistaken , i asked for help with the random numbers generator. I didn't do C++ for quite some time, but i started again. So here is what i have : [CODE]#include "stdafx.h" #include <iostream> #include <fstream> #include <ctime> using namespace std; int main(){ srand(time(NULL)); …

Member Avatar for Jackk123
0
141
Member Avatar for waqarrashid33

hello.. Can any one provide me the code in c++ of deleting the folders or a folder that is not empty..plzz

Member Avatar for Ancient Dragon
0
34
Member Avatar for ineedurhelp

I know that this is a c++ forum but im a college student and i cant practice the programs without clearing this problem coz most of the programs require "resource.h" this program is to attach a menu to a window [code=c++] #include<afxwin.h> #include"resource.h" class myframe:public CFrameWnd { public: myframe() { …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for kgz

Hi, i have a project using basic inheritance to output shapes, but i would like to make it draw the shapes aswell. Does anyone know where i can find tutorials on how to draw shapes in dos using C++? thanks

Member Avatar for Fuseteam
1
5K
Member Avatar for woody363

I'm having difficulty getting graphics into my C++ program. using Ubuntu 11.10 I /think/ my problem is simply my inability to download and install graphics libraries. Basically at the #include ... section of code i get an error every time about being unable to find xyz which i haven't managed …

Member Avatar for woody363
0
285
Member Avatar for lolwut25

I have an assignment where I have to write a program to prompt the user for a file name and location (it is a text file), once the user has entered that, a menu pops up and gives the user 4 options and asks which one they would like to …

Member Avatar for Lerner
0
2K
Member Avatar for Despairy

is there a warior i can do the following: lets say i have [CODE]string userChoice;[/CODE] assume i have a Warrior class with move function in it is it possible to define : [CODE]#define WARRIOR "Warrior"[/CODE] and than use [CODE]userChoice=WARRIOR;[/CODE] and call the function [CODE]userChoice.move()[/CODE]? [CODE]void play(char gameWorld[][BOARD_SIZE]) { Warrior War(1,1); …

Member Avatar for Despairy
0
152
Member Avatar for vlaskiz

So here I am, having a difficult time figuring out what's the problem, first of here's the code: [COLOR="red"]Preke.H[/COLOR] [CODE]#include <string> #include <sstream> #include <iomanip> using namespace std; class Preke { private: string pav; // prekÄ—s pavadinimas int atdata; // atvežimo į parduotuvÄ™ data int pardata; // pardavimo data int …

Member Avatar for mikrosfoititis
0
273
Member Avatar for rsashwin

Hi guys, I am implementing a singly linked list. The thing is whenever my str_temp goes above 12-15 elements, i get this error malloc: *** error for object 0x1099008b8: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug …

Member Avatar for mazzica1
0
153
Member Avatar for smata

Consider a used-car yard called [B]Second Car Sales[/B] that needs to store details of the vehicles they have in stock. For each vehicle, we need to store the following details; Registration number, Make, Distance traveled in miles,Buying price and Selling price($) and Name of previous owner. [U]Required[/U]. (1) You are …

Member Avatar for Schol-R-LEA
0
129
Member Avatar for croussou

Hi guys, I have been given a task in my C++ course to develop an application that will ask the names of the students and store the entered values into a string type array. Considering each student has participated in four exams, the program should ask the points received and …

Member Avatar for croussou
0
242
Member Avatar for pendo826

Can Anyone advise me on the problem with the namespace in this code im getting an error. [CODE]//Main. #include "Weapon.h" #include "Room.h" #include <iostream> #include <fstream> using namespace std; int main() { ifstream myfile; string line; myfile.open("BronzeSword.txt"); if (myfile.is_open()) { while ( myfile.good() ) { getline (myfile,line); cout << line …

Member Avatar for pendo826
0
154
Member Avatar for phorce

Hello, I'm trying to read in words from a text file that look like: The World Fell Over etc.. But it doesn't seem to be working.. I've written some code however it will only show the first word OR loads of question marks.. [code] string dictionary() { string words[500]; ifstream …

Member Avatar for thines01
0
134
Member Avatar for karmstrong

So my code will compile and I do get output but it does not look the way its suppose to. I'm also not certain I am doing the virtual functions properly Expected Output Telephone Number : NPA-NXX-Line Customer: CustomerName Number of Working Lines: NumWorkingTNs Current Output derived class WorkTelephoneNumber constructor …

Member Avatar for mazzica1
0
172
Member Avatar for stereomatching

[code] struct S { double operator()(char, int&); }; int main() { boost::result_of<S(char, int&)>::type f = 3.14; // f has type double } [/code] OS : win7 compiler :gcc mingw4.6.2 error message : error: no class template named 'result' in 'struct S'| error: expected ';' before 'f'| error: 'type' is not …

Member Avatar for vijayan121
0
214
Member Avatar for naifa55

hi, How to write code to convert to prepare one's complement and tow's complement in c++

Member Avatar for naifa55
-1
94
Member Avatar for pendo826

Hey im a real noob at c++ and im trying to understand creating rooms setting a default and using a .txt file for room details. but i dont understand it. Im looking at some code from my lecturer and i dont understand were the wiz0-2.save comes from can some tell …

Member Avatar for mikrosfoititis
0
132
Member Avatar for bobytch

Hello everyone in this activity i should use if, else if, Boolean, for loop, do while loop ok here is the OUTPUT i must do: GRADING SYSTEM! 96-100 =1.00 94-95 =1.25 92-93 =1.50 90-91 =1.75 88-89 =2.00 86-87 =2.25 84-85 =2.50 82-83 =2.75 80-81 =3.00 78-79 =3.25 75-77 =3.50 74-below …

Member Avatar for CSloan7597
0
189
Member Avatar for ziggystarman

Passing Managed ByteArray to Native C++ DLL Anyone could help regarding passing ByteArray containing image data from axis camera to Native C++ DLL, Both compile OK, but DLL does not write ByteArray data to file?, just wondering if this is the correct way to pass ByteArray's to C++ DLL's here …

Member Avatar for ziggystarman
0
2K
Member Avatar for nickThebeginner

I am using window 7 as a operating system and i run this code in same os it shows the problem related to file handling but this problem wasn't occurred on xp and vista whats the problem ........???????????? try to run on win 7 and xp you will get the …

Member Avatar for mazzica1
0
177
Member Avatar for Srinivas0

i am trying to print multiplication table by using for loop but it is showing only the last one instead of displaying all. :( [CODE]#include <iostream> using namespace std; int main() { int i,j, k; cout<< "enter i value"; cin>> i; for(j=0;j<20;j++) k=i*j; cout<< k <<endl; return 0; } [/CODE]

Member Avatar for frogboy77
0
128
Member Avatar for daldrome

I have created a program to generate a set of characters in an array. The objective is to move all vowels generated by the array to the left, for example: given the following array: A B C D E F G H I J K L M O P Q …

Member Avatar for daldrome
0
158
Member Avatar for edgar5

I am working on a WIN32 (not MFC) project. Currently it uses the default XP and earlier file dialogs. In attempting to add the option, under Win7/Vista, to use the new-style file dialogs, I have come to a stumbling block. The only code examples I can find come from here: …

Member Avatar for edgar5
0
2K
Member Avatar for beeho

Hi all, I'm having a problem here!! I've attended a lecture on Implementation of stacks in c++ using arrays and it wasn't really hard to understand, but now I'm supposed to know how to Implement a stack using linked list, that's the problem. help please?:confused:

Member Avatar for beeho
0
279

The End.