49,755 Topics

Member Avatar for
Member Avatar for LevyDee

I haven't really found anything on the topic other than its bad to cast, but I would assume there is a "proper" way to accomplish this. To illustrate: Class B and Class C both inherit from Class A. I have a function MyFunction(A obj); In MyFunction() I would check if …

Member Avatar for LevyDee
0
118
Member Avatar for fsefsef23

I have a homework question that instantiates 4 node pointers, *p, *q, *r, *t, and the first three have a number, 1, 2, and 3 respectively. I have to draw out (using 'blocks' and arrows) what the memory would look like when these lines of code occur: p->next = q; …

Member Avatar for LevyDee
0
175
Member Avatar for thecoolman5

Hi, I am using DEV-C++ and i am wondering how to declare variables in a windows project. I am trying to make a calculator and i need it to declare a variable a certain number when you press a button. I also need it to declare a char after you …

Member Avatar for thecoolman5
0
178
Member Avatar for nora-s

hi : ) I wrote this code for count a specific word selected by user in an array but it have a logic error .. and also is there another way to write it without using pointer ? [ICODE] #include<iostream> using namespace std; int j,i=0; const int size=500; char array1[size],search[100],*cnt; …

Member Avatar for NathanOliver
0
227
Member Avatar for toneranger

Hi, I have a csv datafile with stock price data that I've read into a vector of structures that looks like this: 09/11/2009 9.30 open, high, low, close, volume 09/11/2009 9.31 o, h, l, c, volume and so on to 09/11/2009 16.14 o, h, l, c, volume //next day starts …

Member Avatar for Ancient Dragon
0
239
Member Avatar for aiwasen

I'm having a problem on try again program.I checked the syntax and yet is still not working.am trying to make a program that will output the student's grade and when the program is finished it will ask whether to try again or not.If the input is y or Y, the …

Member Avatar for WaltP
0
3K
Member Avatar for DJSAN10
Member Avatar for Muhammadlodhi

Hi I am making a banking system in c++ but getting a problem I am not sharp in programmin if you can help then thanks [CODE]//*************************************************************** // HEADER FILE USED IN PROJECT //**************************************************************** #include<iostream> #include<conio.h> #include<stdio.h> #include<process.h> #include<fstream> #include<ctype.h> //*************************************************************** // CLASS USED IN PROJECT //**************************************************************** using namespace std; class …

Member Avatar for Salem
0
965
Member Avatar for the_kitoper

[CODE] #include <time.h> time_t whatTime(const char* month, const char* day, const char* year) { time_t rawTime; time(&rawTime); struct tm* convTime = localtime(&rawTime); std::cout << "Today is: " << ((convTime->tm_mon)+1) << "/" << convTime->tm_mday << "/" << convTime->tm_year << std::endl; } [/CODE] When using this code I get the output '7/27/111' …

Member Avatar for pseudorandom21
0
175
Member Avatar for tiredoy

These days ,I am learning inheritance and dynamic binding. I could figure out what the code means. However, I can't see much point in setting such base classes So,I want to know why should we set up base classes and derived classes

Member Avatar for mike_2000_17
0
229
Member Avatar for Raim

Basically, I made a small calculator. It does the PEMDAS and factorials. Part of my code is here:[ICODE]#include "stdafx.h" #include "iostream" #include "stdio.h" #include "math.h" using namespace std; short MENU (void); void raiz (void); void suma (void); etc..... [/ICODE] [CODE]int main () { short OPC; OPC=MENU (); do { switch …

Member Avatar for mrnutty
0
117
Member Avatar for ordinary jam

i'm trying to add two fractions via a function and it works. the problem is that i have to print the fraction in the main( and i have absolutly no idea how to do that) other than that the program works fine. [CODE]#include<stdio.h> #include<conio.h> #include<iostream.h> int frac(int,int,int,int); void main() { …

Member Avatar for mrnutty
1
1K
Member Avatar for ogopa100

Hi, I am trying to change this program to compile in g++ compiler in terminal in linux. I have reached a point where I am stuck. I would really appreciate some help. I am getting the following errors: test@linux:~/signalgenerator> g++ -o audio audio_backup.cpp -lasound audio_backup.cpp: In function ‘int main(int, char**)’: …

Member Avatar for Salem
0
264
Member Avatar for tiverton

I have run into a unsolvable runtime error, I always get the message invalid floating point error, with the following C++ program. This program reads floats from a file(float.txt) 1.56 .98 5.78 Then sorts to put the largest float on top. But when I try to read this I get …

Member Avatar for tiverton
0
202
Member Avatar for annitaz

My code for the calculator is: calculator.h [CODE]#ifndef CALCULATOR_H #define CALCULATOR_H #include <QWidget> #include <QGridLayout> #include <QLineEdit> #include <QLabel> #include <QPushButton> #include <QLCDNumber> #include <QString> #include <QMessageBox> #include <QErrorMessage> class Calculator : public QWidget { Q_OBJECT public: //constructor Calculator(); public slots: //function to add the two numbers that the user …

Member Avatar for imolorhe
-1
359
Member Avatar for itgrowsind

I have to write a code that accepts 5 grades and sorts them from smallest to greatest using linked list.This is what I have so far using examples from the book. #include <iostream> using namespace std; struct List { int value; List *next; }; int main() { int num, num1,num2,num3,num4; …

Member Avatar for Saith
0
135
Member Avatar for shadowscape

Hello, I'm trying to write a function for a DLL in c++ what would check if a website is online or not and return either a error or the status code returned from the server, is there are any clever people out there, your help would be awesome, thanks. i …

Member Avatar for JasonHippy
0
2K
Member Avatar for fashxfreak
Member Avatar for jaimee

How can I start doing a program using pop-up menus in C++? with the choices which are clickable? which code I should use?thank you.

Member Avatar for Frederick2
0
56
Member Avatar for turista

Hi i saw a post about this program already. im new to c++ and im lost... completely lost... im not even sure im posting this in the right place. anyways. the program i got is working correctly until i make it an OOP which is what my teacher wants us …

Member Avatar for Chilton
0
247
Member Avatar for awah mohamad

hi guys.. i am new to c++ and i am having a problem running it couz it usually says: [CODE]11 C:\Dev-Cpp\conio_test1.cpp `cout' undeclared (first use this function) [/CODE] this is my code and please try to help me! [CODE] #include<iostream> #include<conio.h> int main() { int a =0; while(!kbhit()) { printf("%a …

Member Avatar for sashankalladi
0
180
Member Avatar for fsefsef23

I have a homework question that simply shows a linked list of 3 elements (each one with a character in it, 'A', 'B', and 'C' respectively), with the 'head' pointer pointing at the first value of the list, and a 'current' pointer set to null. The question wants me to …

Member Avatar for sashankalladi
0
98
Member Avatar for radiata

Hello, I'm supposed to write a programming project that reads 2 files and then organizes the numbers into an output file in order from smallest to largest. The input files are as they appear: 1 4 5 and also 2 3 6 Right now I'm having trouble with the output …

Member Avatar for WaltP
0
121
Member Avatar for Xoltha

Hi, I have a problem with L-systems recursion, I tried a lot of ways to figure out how to make my fuction recure but I have no luck at all. What the program must do is the Koch system or rather the replacement rule, where by everytime the fuction recurs, …

Member Avatar for teo236
0
172
Member Avatar for dilequeno

I am trying to create a very large 3D array. I am currently using a psuedo-3D array with a 1D array. Here is what I have so far: [CODE]#include "stdafx.h" #include <iostream> #include <iomanip> #include <fstream> #include <istream> #include <string> #include <vector> #include <numeric> using namespace std; const int depth …

Member Avatar for Greywolf333
-1
195
Member Avatar for toneranger

I'm reading a big csv file into a data structure defined as such: [CODE]struct PriceInfo { double Open; double High; double Low; double Close; unsigned int Volume; unsigned int Time; std::string Date; };[/CODE] So somewhere in my main function, I have this line: // read contents of datafile by overloading …

Member Avatar for danb737
0
583
Member Avatar for awah mohamad

hey guys i am planning to program a website and a software that connects to the website and get information from the website..the web part is easy and i made it but for the program, is c++ good for such a program?? and if yes, which library do i need …

Member Avatar for Awah Mohamed
0
143
Member Avatar for LevyDee

I am confused! [code] void AnimationEngine::AddAnimationSet(Animation* animations) { AnimationSet* newSet = new AnimationSet(); for(int i = 0; i < (sizeof(animations) / sizeof(Animation)); i++) { for(int n = 0; n < animations[i].AnimationConditions.size(); n++) { //newSet->conditions is of type std::vector<std::vector<myType>> //animations[i].AnimationConditions is of type std::vector<myType> newSet->conditions[i] = animations[i].AnimationConditions; } } //Stuff unrelated …

Member Avatar for mrnutty
0
165
Member Avatar for dylank

Hi, I have asked StackOverflow, compared my code to multiple different online sources, but I still cannot get the page status from the server. The library I am using is Wininet, and the function failing to retrieve the correct data is HttpQueryInfo. I am linking against wininet. Code: [CODE] int …

Member Avatar for dylank
0
317
Member Avatar for logan_231_2009

Hello everyone, congratulations for the good job. The last 5 days i search for a comprehensible and simple, CPM algorithm and i can't find one. I want to make a program (in C++) that it will calculate the critical path of a given number of nodes..Any ideas? thanks for reading, …

Member Avatar for user786
0
3K

The End.