Hi After getting great help with my first post here I thought I would try again. I need to create a (dynamic) number of objects of two types, eggs and fry. I then need to be able to delete the fry and then make a new group of fry objects with all the info from the members of the egg objects (i.e. the egg objects will become the new fry objects). the number of objects will vary so I cannot just over write the old values. I have some code that actually works, but as the program exits a Windows …

Member Avatar
Member Avatar
+0 forum 4

I'm writing a simple one window program with inputs and outputs in a GUI. My problem is that I don't know what program to use to make the graphics and then implement them into the window I am using. I just need to be able to make simple vector objects that I can control and minipulate. I've looked around and have gotten confused on what to use. Any help would be greatly appreciated.

Member Avatar
Member Avatar
+0 forum 6

Hi.. plz I need ur help.. I wrote my assignment & it runs but, not all statements can be executed I don't know why?? could u help me?? :sad: this is my code: #include <iostream.h> int check(char x){ if( x=='a'||x=='b'||x=='c'||x=='d'||x=='e'||x=='f'||x=='z' ) return 1; else return 0; } class CarADT{ private: float fuel, water, oil; int switchOn; int speed; public: CarADT(){ fuel = 100.0; water = 4.0; oil = 5.0; switchOn = speed = 0; } void Switch(){ switchOn = 1; cout<<"The car is switched ON\n"; } void setspeed(float s ){ speed = s; } void FillTank(){ fuel = 100.0; } …

Member Avatar
Member Avatar
+1 forum 4

Hi All, i have just started to look into picking up a bit of c++. i've been having a search about on the net for some tutorials and web links to help me learn but so far i havent really found much. can anyone out there drop me some links to good newbie resources on learning c++. if it helps i have a copy of MS visual studio 6.0, so anything to help me get a grip on how this environment works would be great, as well as codeing within it. cheers spikes

Member Avatar
Member Avatar
+1 forum 4

Hello C++ Guys, is it possible to make automatic frames for pictures on my web site with C++? Thank you very much for your help. Have a nice Christmas, Josef

Member Avatar
Member Avatar
+1 forum 8

i am currently making a game i am rushed and cant put much more. basics: im 14 and do not have company need good C++ programmers Need good graphics programmers for 3-d need good AI programmers i will post more later.........

Member Avatar
Member Avatar
+1 forum 37

Hello all, I will start off by saying Im in the dark with some aspects of C++, in an intro computer course at college. My question is about how to use char commands for when I have multiple users using the same segment of C++. ex. 3 users are asked to enter their height etc..... Im not sure how to go about the it for 3, 1 user is easy and I have no problem. Any thoughts or how to's would be appreciated Thanks Pete

Member Avatar
Member Avatar
+0 forum 5

What is the difference between function template & template function? Thanks.

Member Avatar
Member Avatar
+0 forum 1

Hello.I am having some problems with my vc++6 compiler.Here is the code: [CODE] #include <iostream.h> class SimpleCat { public: SimpleCat() { itsAge = 2; } // if I put the definition of the function into the daclaration,that becomes an "inline" function ~SimpleCat() { } // class destructor int GetAge() const { return itsAge;} void SetAge ( int age ) { itsAge = age;} private: int itsAge; }; // class declaration ends int main () { cout << " generally,to access data members and functions,\n"; cout << " we use the dot (.) operator...\n"; cout << "but here while accessing the …

Member Avatar
Member Avatar
+0 forum 1

Hi, I am currently working on a program that compiles fine and runs OK to give some results. However, when I try to split the program into 3 parts, it it gives some weird compilation errors. Initially I had one program, calc.cpp that manipulates polynomials (adds/ subtract/multiply them). However when I split the program into three, polynomial.h, polynomial.cpp and calc.cpp I get complilation errors. Calc.cpp has polynomial.h included. Yet, when I call functions from polynomial.h it gives the following errors like it can't find the functions from polynomial.h. getpoly, add, compare, print are all functions in polynomial.h that I am …

Member Avatar
Member Avatar
+0 forum 1

[b]Last transmission from Starbase XY003 -- the galaxy's last out*post*[/b] [size=2][url="http://undergraduate.csse.uwa.edu.au/units/231.312/Clect1.pdf"][u][b][color=red]http://undergraduate.csse.uwa.edu.a....312/Clect1.pdf[/color][/b][/u][/url][/size] [size=2][url="http://www.teicontrols.com/notes/C_Programming/C_ProgrammingNotes.pdf"][u][b][color=red]http://www.teicontrols.com/notes/C_...ammingNotes.pdf[/color][/b][/u][/url][/size] [size=2][url="http://www.oucs.ox.ac.uk/documentation/userguides/c/l922.pdf"][u][b][color=red]http://www.oucs.ox.ac.uk/documentat...ides/c/l922.pdf[/color][/b][/u][/url][/size] [size=2][url="http://oscinfo.osc.edu/training/C/ccourse_fix.pdf"][u][b][color=red]http://oscinfo.osc.edu/training/C/ccourse_fix.pdf[/color][/b][/u][/url][/size] [size=2][url="http://ei.cs.vt.edu/%7Ecsei/project/sf/notes/cprog.pdf"][u][b][color=red]http://ei.cs.vt.edu/~csei/project/sf/notes/cprog.pdf[/color][/b][/u][/url][/size] [size=2][url="http://www.strath.ac.uk/IT/Docs/Ccourse/"][u][b][color=red]http://www.strath.ac.uk/IT/Docs/Ccourse/[/color][/b][/u][/url][/size] [size=2][url="http://www.cs.cf.ac.uk/Dave/C/CE.html"][u][b][color=red]http://www.cs.cf.ac.uk/Dave/C/CE.html[/color][/b][/u][/url][/size] [size=2][url="http://www.cprogramming.com/"][u][b][color=red]http://www.cprogramming.com/[/color][/b][/u][/url][/size] [size=2][url="http://www.eskimo.com/%7Escs/cclass/cclass.html"][u][b][color=red]http://www.eskimo.com/~scs/cclass/cclass.html[/color][/b][/u][/url][/size] [size=2][url="http://www.lysator.liu.se/c/"][u][b][color=red]http://www.lysator.liu.se/c/[/color][/b][/u][/url][/size] [size=2][url="http://www.eskimo.com/%7Escs/cclass/notes/top.html"][u][b][color=red]http://www.eskimo.com/~scs/cclass/notes/top.html[/color][/b][/u][/url] [b]Here are some compiler links:[/b] [/size][size=2] [size=2][url="http://www.gnu.org/software/gcc/gcc.html"][u][color=red]http://www.gnu.org/software/gcc/gcc.html [/color][/u][/url] [/size][/size] [size=2][size=2][url="http://www.delorie.com/djgpp/"][color=red]h[u]ttp://www.delorie.com/djgpp/[/url][/u] [/color][/size][/size] [size=2][size=2][url="http://http://users.cyberelectric.n...nkCompilers.htm"][color=red]h[u]ttp://http://users.cyberelectric.n...nkCompilers.htm[/url][/u] [/color] [/size][/size][size=2][size=2][url="http://http://www.willus.com/ccomp.shtml"][color=red]h[u]ttp://http://www.willus.com/ccomp.shtml[/url][/u][/color] [/size][/size] [size=2][b]Read the sig for a better understanding[/b] [/size] [B][edit] link colours changed. peterska2[/B]

Member Avatar
Member Avatar
+0 forum 2

[b]Working With C++ [/b]C++ syntax is the way which the code is arranged to form the language. Each computer language has its own unique syntax. For example, the syntax for adding two numbers may be different in one language than in another. Syntax is to programming as grammar is to literature. For the most part, C++ code is divided into expressions, statements, and declarations. Each of the three use different syntax which tell the computer that they are to be handled differently. [b]Declaration Statements[/b] Declaration statements are, simply put, used to declare variables. As in math, computer variables are letters …

Member Avatar
+0 forum 0

[b]OOP[/b] C++ is an object-oriented programming language. In other words, it contains what are known as objects, such as classes and structures, which allow the easy manipulation of large amounts of data. The easiest way to think of them are as records. [b]Creating Data Types[/b] When one creates a class, they are creating their own object type. For example, suppose one wants to write a program to manipulate student records. Each student record contains the student's age and phone number, suppose. This would be accomplished by writing a class named student which handles two variables: age and phone. Throughout the …

Member Avatar
+0 forum 0

How can you set the precision of a floating point value for output using the Console::Write method? In the past, with cout, you just used setprecision() but that doesn't seem to work with the Console functions.

Member Avatar
+0 forum 0

Ok guys... I'm sorta new to this forum.. so hello all.. but neways.. here is my problem.. This is the assignment I have: [url]http://www.ece.uc.edu/~berman/228-2003/program2.html[/url] Can someone basically explain what I should do? Am I supposed to like sort part of it using insertionsort and the other part with one of the other 2? I'm confused as to this whole threshold thing. Here is what I have so far: [code] /* Program 2 Author: B. Josh Becker */ #include <iostream> // preprocessor #include <ctime> #include <cstdlib> #include <cstdio> using namespace std; void mergesort(int[], int, int); void merge(int[], int, int); void quicksort(int[], …

Member Avatar
Member Avatar
+0 forum 1

Below is posted a program as assigned halfway through my C++ class. I do not need any help doing the project itself, I just need help trying to get through the typographical errors and vagueness! Can someone give a shot at possibly trying to rewrite what he is asking for? In my opinion one aspect of what he is asking for is conflicted 3 times! Write a program with overloaded function for computing the average of integers, or appending characters (same name average for both functions). The integer unction should allow between 1 and 5 arguments, the character function between …

Member Avatar
Member Avatar
+1 forum 4

I stared at it for about a good 30 minutes now and I still can't find anything wrong with it. Can someone help? [CODE] /*This program makes all vowels uppercase. All other constants are lowercase. Keep in mind I make to call a function isvowel() to evluate the character.*/ #include <stdio.h> #include <ctype.h> int isvowel(int ch); int main(void) { int ch; while(ch=getchar()){ if(isvowel(ch)==1) putchar(isupper(ch)); else putchar(islower(ch)); } return 0; } int isvowel(int ch) { if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u') return 1; }[/CODE]

Member Avatar
Member Avatar
+0 forum 3

Hello.I have been using Microsoft Visual Studio 2000 enterprise edition and I'm having a problem with linking files.I have saved a file named as "class declaration.h" by default and another named as "cppfile.cpp" by default.Let me tell you how I actually started this.First I created a new project workspace and then a c++ header file.I saved the header file ( my compiler or vc++6 saves header files as .h by default not .hpp) and opened a c++ source file.I saved the source file too and then compiled and got only 1 error saying that my .h file didn't exit.I have …

Member Avatar
Member Avatar
+0 forum 1

#include <iostream.h> #include <conio.h> void gas(); void main() { float gal; while(gal<=0) gas(); cout<<"thanks for your help"; getch(); } void gas() { float gal; float total; float miles; float avg; cout <<"enter the gallons of gas used (-1 to end): "; cin >> gal; cout <<"enter miles driven: "; cin >> miles; avg=miles/gal; cout <<"the miles / gallon for this tank was "<<avg<<endl; cout<<"\n"; } ------------------------------------------------------------------------------ i'm tring to get float gal value to be shared between gas and main. so that if -1 is enter for gal the while loop will exit. help would be aprecaited.

Member Avatar
Member Avatar
+0 forum 4

Here's my code. I just want to return the length of a string. How do I do that? Any assistance would be greatly appreciated. [code] #include "stdafx.h" #using <mscorlib.dll> using namespace System; int _tmain() { String *strString; int intLength; Console::Write(S"Enter a String "); strString = Console::ReadLine(); Console::Write(strString); intLength = strlen(strString); Console::Write(intLength); return 0; } [/code] I run this and get a slew of "Cannot convert..." errors.

Member Avatar
Member Avatar
+0 forum 9

// This program asks the user to enter the length of a rectangle // then for the width of a rectangle , to find the perimeter by // this 2 * length + 2 * width #include <iostream.h> return unsigned long int Perimeter ( unsigned short int , unsigned short int ) ; // function prototype shown int main () { unsigned short int length ; unsigned short int width ; unsigned long int Perimeter ; cout << " Please enter the length of the rectangle: " << length << endl ; cin >> length ; cout << " Please …

Member Avatar
Member Avatar
+0 forum 10

well this is what my program does: //asks for input for number of gallons enter the gallons of gas used (-1 to end): //asks for input for number of miles enter miles driven: //then shows the miles / gallon for this tank the miles / gallon for this tank was ... it loops this untill the user presses -1 then i want it to find out the avg of all the miles/gallons. problem is that avg is over written every time the loop starts here is the code for the program. #include <iostream.h> #include <conio.h> float gal; float avg; void …

Member Avatar
Member Avatar
+0 forum 1

Hi.I have been learning c++ lately and I'm rather interested in learning to produce source codes and applications(games maybe).I need know that whether my choice about learning c++ for game programming is right or not.I'm not interested in web developement.I have read some of the posts in c++ forums and gained some knowledge. :cool: everybody is talking about IDE'S or Integrated Developing Environment but I think all langauges have IDE's except the old ones? Like,I have a c++ compiler.I have been told that it's possible to link a text file written in notepad with my compiler and then run it.I …

Member Avatar
Member Avatar
+0 forum 1

well i made this little program to help me check my algebra home work it was soppose to be a simple thing so it is badly coded and rushed but something has happened that i dont understand. i have spotted the problem but dont know why its doing this. for values a=1 b=-2 c=-3 it works fine i get the right answer but for values a=1 b=8 c=10 ths anwser should be -1.55 or -6.45. problem is it does the wrong if statement but why?. this program is for the algebra equation (-b(+)(-)root(b^2-4ac)) /2 #include <iostream.h> #include <conio.h> #include <math.h> …

Member Avatar
+0 forum 0

Home work agian. I'm required to write a sales analysis program. One of the function dose enter a new salesperson, it will prompt for personal detail. but if user keys in -1 at any point, it will cancel process and return to main menu options. BUT according the programming standards of this, " GOTO statement, BREAK keyword and EXIT function are NOT allowed in any program. In C++ the use of Return to jump out of a function premeaturely is not Structured and therefore not allowed". What can I do ?Thanks!!

Member Avatar
Member Avatar
+0 forum 3

:lol: HI i'm really new to c++ programming.I have learning this language with the help of a book named "Teach yourself c++ in 21 days by Sams." I am in day 4 learning expressions and statements.How long do you think it's going to take me to produce a fully-functional c++ programm all by myself? I mean,if i really finish this book in 21 days ( that means I only work with c++ all day nothing else!)...how long should it take for me? :cry:

Member Avatar
Member Avatar
+1 forum 4

ok, i'm new to c++, please bear with me........ i have a program... it asks the user to enter the price, then it asks to enter the interest rate from, and then interest rate to, and then the loan period (> 2 years) The formula used is: result = price * pow(1+annual rate of interest/100/365, loan period *365) it should be desplayed like this: 8% 9% 10% Year 2 result result result year 3 result result result . . year 4 result result result the preceding was if: interest rate from was 8, and interest rate to was 10, and …

Member Avatar
Member Avatar
+0 forum 1

I am new to c++, and i have a program to do as follows: 1) fill a 2D array for the seat chart with * ... DONE 2) add a passenger to the plane I am stuck here, i have the info put into the cin statements etc, but how do i make it so that it makes an 'X' in the seat that they want to sit in ????? 3) sort the list of passengers added I have written a selection sort as follow: (can anyone tell me why it will not compile with code? //prototype: void print_list(pass_rec passlist[size] …

Member Avatar
Member Avatar
+0 forum 1

Hi every one, I just want to do a interesting work. But I can't find any clue. Anyone there to help? We know in Destop there are some shortcuts to link a particular program. I want to retrive the information of the shortcut when I click on a particular item. I want to do it by VC++ .I have desing the problem such this way: I have a form running on desktop. When I click on a shortcut the Image of that shortcut and other information will be displayed in my form.Then I can activate that shortcut or delete that …

Member Avatar
+0 forum 0

Hi again.Read the source code below please: // Determining the size of variable types #include <iostream.h> int main() { cout << " The size of a bool is:\t\t" << sizeof(bool) << " bytes.\n"; return 0; } p:s:I have not included the other variable types because there was no error message for them.The error message says the bool is an undeclared identifier.c++7,or c700.that's what my cd says!I don't know how to write my code in notepad and then transfer my file from notepad to the compiler to link.I have Borland Turbo C++ Version5.02 in that cd.Should I try to install turbo …

Member Avatar
Member Avatar
+0 forum 5

The End.