51,593 Topics

Member Avatar for
Member Avatar for axfv

I have classes A1, A2, B, and C. A2 inherits from A1. C inherits from A2 and B, and its constructor initializes all B, A2, and A1 variables. As a tree, it looks like this: [CODE] C / \ B A2 | A1[/CODE] I have a function [I]Foo [/I]that takes …

Member Avatar for ArkM
0
179
Member Avatar for Bladtman242

Hi, are there some libraries i can use (in MS windows) for stuff like, obtaining info from a website? i read something about sockets once, but im not sure what it is (yes, i googled it :) ) Or would be easier/better, as some suggest, to learn java or python? …

Member Avatar for Bladtman242
0
147
Member Avatar for bob89

I am new to c++ but have been using java for a while now. I am using Microsoft Visual c++ and when I try to build it I get the following error: Linking... Airline Project.obj : error LNK2019: unresolved external symbol "public: __thiscall FlightManager::FlightManager(void)" (??0FlightManager@@QAE@XZ) referenced in function _wmain F:\Documents\Assignments\CA212\Airline …

Member Avatar for Narue
0
109
Member Avatar for ganmo

Hello, I'm reading a chapter about virtual function. So what I know is that virtual function is equal to abstract functions. It is enough to declare one function virtual to make the class into an abstract class. E.g. [CODE=cpp] class Base { public: Base(); virtual set(); } [/CODE] Now I'm …

Member Avatar for ArkM
0
103
Member Avatar for gr8ash

hey all,,, i've been trying to make my own setw function that will do the same jop of setw,, this is my first year in college i study CIS in Jordan,,, so, i made this code but6 i still have problims with float numbers, it seems like this code work …

Member Avatar for ArkM
0
230
Member Avatar for pvsumanbabu

Hi All, can any of u explain the order of constructors ,how it will behaves when order of derived classes as like present in attachment

Member Avatar for Narue
0
95
Member Avatar for Clawsy

I try to program DirectX in Visual C++ 2008. I need at least a win32 working window. I have a BIG problem compiling win32. First, I created a win32 project (a simple Win32 Project - not empty). I don’t modify any code compile when compiler says: Cannot find windows.h. So …

Member Avatar for Clawsy
0
350
Member Avatar for nicolap

Hi, I'm working on a C++ project and in a menu I want the user to choose 1, 2, 3 etc... integer number. If they input a float i.e. 1.2 I want the code to tell them they've entered something invalid, rather than just rounding it down to 1. how …

Member Avatar for vmanes
0
209
Member Avatar for mathueie

Hi, I am using ubuntu linux. I am trying cpu utilization of our software. How to use iostat in c++ program.

0
82
Member Avatar for Jacky1

I need a way to send email through smtp server ssl secured Programming Language: C++ Platform: Windows XP I need something doesn't involve visual studio Thanks in advance!

Member Avatar for William Hemsworth
0
232
Member Avatar for stonerain

[CODE]int C[10][20]; int * mmatrix (int A[ 10 ][ 5 ], int B[ 5 ][ 20 ]) { int i, j, k; for(i = 0; i < 10; ++i) for(j = 0; j < 20; ++j) { for(k = 0; k < 5; ++k) C[ i ][ j ] += …

Member Avatar for Salem
0
1K
Member Avatar for scuzzo

I need to output the first five lines or the last five lines of a .txt file the user provides while using switches in a command prompt. I've got it other than printing the lines to the screen. [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; const int …

Member Avatar for NathanOliver
0
93
Member Avatar for Lukezzz

I am reading a .txt file line by line and when the line in the file is "Hello1", I want to Replace that Line with "Hello2" but I dont get that to work. I think I miss something out here [code] //Save this emailadress to the RouletteDataBase file String Path …

Member Avatar for landonr
0
280
Member Avatar for daviddoria

I was looking at this: [url]http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18[/url] I don't understand [code] File f = OpenFile("foo.txt"); [/code] It seems like File is one class, and OpenFile is a separate class, so how can you assign an OpenFile to a File? Also, is it necessary to have this second class? Why not something …

Member Avatar for Ancient Dragon
0
297
Member Avatar for BlackStar

[ICODE] #include <iostream> #include <cstdlib> using namespace std; struct A { A *B; }; struct C{ C*D; }; int main() { A * Z = new A; C * Y = new C; Z = Y; cin.get(); return 0; } [/ICODE] it says cannot convert Z to Y in assignment.

Member Avatar for NathanOliver
0
102
Member Avatar for bmcutler011

[code] #include<iostream> #include<fstream> #include"d_nodel.h" using namespace std; int main() { dnode<double> *listA = new dnode<double>; dnode<double> *listB = new dnode<double>; double sz1, sz2; int val1; //first set of integers int val2; //second set of integers ifstream inFile; //declares the inFile ofstream outFile; //declares the outFile //Read in a file to …

Member Avatar for NathanOliver
0
143
Member Avatar for lqdo

hello all, I'm getting some unexpected behavior from the ifstream object when using the open method. im reading the following characters from a text file: [CODE] ############### # #X# # # ### # # ### # # # # # # # ## ## # # # WWWW###WWWW # # …

Member Avatar for NathanOliver
0
131
Member Avatar for musique

What is wrong with my sorting function? I am trying to put numbers in ascending numbers. [code] void sort(int array[], int numts) { int lowIndex, lowest; for (int count = 0; count < (numts-1); count++) { lowIndex = count; lowest = array[count]; for (int index = count + 1; index …

Member Avatar for musique
0
255
Member Avatar for NathanOliver

hi i have a very large array that i want to populate but i don want to run the for loops every time so i thought i would right a program to output text to fill the array and was wondering if this would work. the array is [icode] int …

Member Avatar for NathanOliver
0
107
Member Avatar for rahul8590

i am working on my project which is on regeression of lines . well i have been successful in fitting a straight line to the given set of coordinates . since i have come so far after a lot of striving , i have been a bit exhausted on writing …

Member Avatar for Salem
0
673
Member Avatar for waldchr

After much frustration of trying to figure it out on my own, I am finally ready to admit that I need help. Does anyone know how to compile allegro 5? (or better yet have a precompiled version I could get my hands on) I have tried many tutorials and none …

Member Avatar for tux4life
1
641
Member Avatar for daviddoria

To redirect clog, I have been using this: [code] std::streambuf* clog_save; std::ofstream ofs; clog_save = std::clog.rdbuf(); ofs.open(LogFilename.c_str()); std::clog.rdbuf(ofs.rdbuf()); cout << "Test cout." << endl; std::clog << "Test log." << endl; std::clog.rdbuf(clog_save); ofs.close(); [/code] However, it seems like bad "code reuse" practice to have to put this in every program I …

Member Avatar for ArkM
0
178
Member Avatar for olejl

I am trying to learn some c++. To do this I have chosen to write an emulator. I had it up and running, but decided to try to make a better architecture. I have a strange problem that I don't understand. If I compile the following code (Visual C++ 2000 …

Member Avatar for ArkM
0
622
Member Avatar for therealsolitare

Hey everyone, I've been getting my rear end kicked by this homework assignment. We were given the task of writing up a command line version of Othello (Reversi) in a higher level language, which I chose C++ to do so in. My C++ version of the code is working great, …

Member Avatar for Salem
0
6K
Member Avatar for saadjaved14

Hey... ok before i start i want to say that i'm not a very good programmer... and i'm new with this... and i got a project that i have to submit in 2 days so i badly need help!! ok the problem is: I'm using binary file handling, a code …

Member Avatar for ArkM
0
107
Member Avatar for U_A_G

so we are starting arrays and our task is to go back to our assignment 2 (functions) and he wants us to run the program using arrays. im pretty stuck and have no clue what to do. [B]heres how assignment (functions)2 looks[/B] [code] #include <iostream> using namespace std; void getEmployeeData …

Member Avatar for VernonDozier
0
129
Member Avatar for weary01

hi there, i do hope someone can help with my delima. yes this is homeowork but i am 80% through my program and only wish to get some guidance on my program. my program has a number of things it has to do and one the things i am having …

Member Avatar for NathanOliver
0
118
Member Avatar for bunnyboy

Hello! I am making a postfix calculator and I want to add in some equation integrity checking. Everything seems to work ( it needs to be done some little improvements, but overall it is working), except when I am checking for the blank spaces the program do not work the …

Member Avatar for bunnyboy
0
161
Member Avatar for pczafer

how im gonna loop menu if option not 1 or 2 ??? [CODE]void display( ) { int option; system("cls"); //clear screen cout<<endl<<endl; cout<<"\t * Display Menu *\n"; cout<<"\n\t1. Display For Certein Date"<<endl; cout<<"\t2. Display All Appointments"<<endl; cout<<"\nEnter Option Number: "; //Enter option cin>>option; cin.get(); switch ( option ) { case …

Member Avatar for tux4life
0
187
Member Avatar for Sky Diploma

As i have written Atoi(); Now i have written Itoa. Here I have used a method of getting the last digit stroring it in an array and then reversing the array to get the required answer. I look forward for Improvements in this code. [CODE=C++] /**************************************************************************** Function Name:: itoa(int ,char …

Member Avatar for Sky Diploma
0
551
Member Avatar for colesefini

Im currently doing a project in QT and when I compile my project with my header/source files that i created, I get this "error: expected constructor, destructor, or type conversion before ‘->’ token ". Essentially i've created my own classes outside of QT and my objects work fine etc but …

Member Avatar for tux4life
0
66
Member Avatar for bilbatori

Hi, I've been trying to identify the error in this code of insertion in a 2-3 Tree. I do know its something with the search function...Can some one figure out whats wronge with the code?? [code=language] bool Two3::Insert(int val) { int x=val; bool done=false;//inserted or not?? if (IsEmpty())//empty tree creating …

0
82
Member Avatar for frossie

for example the sentence in the text file is "daniweb offers the best solutions for C++. the website is www.daniweb.com." i have the user to search the word "daniweb". by using ifstream to read word by word, this is part of my codes [CODE] ifstream file ("lines.txt"); string word; bool …

Member Avatar for rahul8590
0
105
Member Avatar for moteutsch

How can I clone an object in C++, so it is a seperate object, but exactly the same as the original? Thanks, - Moshe

Member Avatar for moteutsch
0
79
Member Avatar for timb89

i want to make a prgoram that will read in a set of numbers and determine whether or not they are prime numbers, this is what i got so far any ideas? [code] #include <iostream> #include <queue> #include <vector> using namespace std; int main() { queue <int> input; queue <int> …

Member Avatar for timb89
0
76
Member Avatar for sinapse

I have this problem to solve for preparing for the olympiad and i'm not quite fond of the functions so that i want to do it classically but i find it harder.Here it goes: "During a desert operation a group of soldiers were lost from different squads.After the storm passed …

Member Avatar for Salem
0
159
Member Avatar for willydlw

my makefile: [code] DRIVER_SRC = PumaDriver.cpp PumaBody.cpp PumaMotor.cpp base_manipulation.cpp serialPort.cpp DRIVER_INC = PumaDriver.h PumaBody.h PumaMotor.h base_manipulation.h serialPort.h silvermax_commands.h All: $(DRI_SRC) $(DRI_INC) g++ -Wall -Wextra -g3 -fpic `pkg-config --cflags playercore` -c $(DRIVER_SRC) g++ -Wall -Wextra -nostartfiles -shared -rdynamic -o libPumaMotorDriver.so PumaDriver.o PumaBody.o PumaMotor.o serialPort.o base_manipulation.o install: cp *.so /usr/local/lib uninstall: rm …

Member Avatar for Salem
0
190
Member Avatar for Lukezzz

Hi I wonder how it will be possible to get the current date and time. I have looked around and there are many different ways to retreive this. I wonder what could be a good way to do that. As for now, I would like to return a string for …

Member Avatar for ArkM
0
103
Member Avatar for fadia

Metro supermarket is a new supermarket opening in Riyadh. It offers attractive discounts for its customers. Write a program that will display to the user his new total price after discount. The program should read the total price from the user, calculate and display the new total price based on …

Member Avatar for fadia
0
163
Member Avatar for ShadowScripter

Mmm, I just love these error messages, I don't understand them what-so-ever and I can't interpret them. (Unsure where the post should be in the forum) I'm getting this error message at build time (Using VC++): [code=cpp]1>Linking... 1>main.obj : error LNK2019: unresolved external symbol _DirectDrawCreate@12 referenced in function "long __cdecl …

Member Avatar for Ancient Dragon
0
270
Member Avatar for nanodano

I've been trying to solve this problem for a while now with no luck. I want to monitor an input buffer(cin) for a keypress. The catch is, I don't want it to hang if the buffer is empty. [INLINECODE]getch()[/INLINECODE] and [INLINECODE]peek()[/INLINECODE] won't work because one waits for a keypress and …

Member Avatar for cniggeler
0
151
Member Avatar for soppyhankins

Hello again all!!! I just have two quick questions... 1.) Is it possible for one to run a program through the "system(command)" and have the output come out on top of an SDL program? Like if I had a background of some sort and typed "system(echo "Hello!")" could I have …

Member Avatar for soppyhankins
0
209
Member Avatar for mightykyle

well i'm trying to get my shuffler to work but i keep getting one. any ideas? #include <cstdlib> #include <string> #include <ctime> #include <iostream> using namespace std; const int number_of_cards = 52; void shuffle(int list[], int size) { srand(time(0)); for (int i = 0; i < size; i++) { int …

Member Avatar for mightykyle
0
198
Member Avatar for Azraeth

Good time of the day for you) I've got a simple question, but just unable to find an answer.. How to make dialogue item (button/scrollbar) visible/invisible? I've tryed ShOwWindow, but i can't point it to my button. Please help

Member Avatar for Azraeth
0
95
Member Avatar for Kamal_Java

Hi I am new to java and need help . Whats the C++ map equivalent in Java. In C++ i can use map for three purposes like i) Sorting while insertion into it ( efficient ) ii) Key ,value iii and for storing unique item. I came to know there …

Member Avatar for Ezzaral
0
136
Member Avatar for Monkey.D.Luffy

[U][B]Question detail as show as below:[/B][/U] How to design a simple grading system which able read data of a group of students. The data includes students’ names, nations, and marks of four subjects. This data is stored in a text file created by a text editor (notepad etc.). The system …

Member Avatar for Sky Diploma
0
396
Member Avatar for Xamas

I have class: [code=c++]template <class T> class Graph; And I have a function: template <class T> void Graph<T>::erase_greater(T needle) { if(TEMPLATE TYPE IS "STRING" OR "CHAR") { do nothing; } else { if(TEMPLATE TYPE IS ONE OF THE INT TYPES) { if(strlen(var1) > strlen(var2)) { USE Var2; } else { …

Member Avatar for twomers
0
178
Member Avatar for Peyton

Hi there, Say I have the following while loop, that loops on the condition that a lne (a string) is received from a file: [CODE]while ( getline( inData2, line ) ) // Increment rows till none left { if ( !line ) { cout << "No data entered. Please enter …

Member Avatar for William Hemsworth
0
148
Member Avatar for hurbano

i have written my code and feel exhausted. when my code finds in error on a given input text file, it does a great job in finding the mismatched symbols. what can i add to show there is no error when no error is found. i attempted adding another else …

Member Avatar for ArkM
0
88
Member Avatar for DaveD3

I am new to C# and .NET and am having a problem. I have a windows form application. I created a Ole data adapter to look at an Access Database with 3 tables. I then created a dataset which gets loaded by the adapter when the process starts. I then …

Member Avatar for Diamonddrake
0
82

The End.