I know that this is an assignment for u and that u must really sux at programmin. unfortunately i was and am in the same boat as u. my 'fly pegion fly' code never compiled and never will. whatever i had is in this thread..
http://bytes.com/topic/c/answers/649...lp-c-text-game
Thats all. Hope u get help from somewhere else asap and good luck with it.
ps- i would rather work on the...
User Profile
Collapse
-
hi.... can i have a look at your fly pigeon fly program...
now im desperately need ur help. i dont have any idea how to start... im totally beginner to c++. plus im not familiar enough with the syntax.
mail the codes to my email please.
myedoro@yahoo.c om
really count on u now... i need to submit this on friday morning. please.
Thanx.
Azura. -
ummmm nevermind i got it; was missing a '=' in this line in Point.h
inline Properties(Poin t mypoint=(0,0),T aste mytaste = SALTY): my_point(mypoin t), my_taste(mytast e){}
but i ll post more after i compile the whole program.
Cheers -
ok so i cleared whatever i could but am stuck with 2 major errors only
Point.h
[code=cpp]
/**
* A Point struct stores the coordinates x, y of a 2D location
*/
#ifndef POINT_H
#define POINT_H
typedef enum
{
SWEET,
BITTER,
SALTY
} Taste;
struct Point
{
int x, y;
inline Point(int X = 0,...Leave a comment:
-
Errors in my code
Fish.h
[CODE=cpp]
#ifndef FISH_H
#define FISH_H
#include <iostream>
#include <vector>
#include "Point.h"
class Fish : public Animal
{
public:
Fish();
Fish(const int fish_breed_time );
inline ~Fish() {decrement_num_ fish_current(); delete *this; };
Point *vector PossibleSurroun dings(all_surro undings);... -
Thanks for the above answers, here a bit more on which i need to undertsand...
What is the purpose of #includ(ing) a class header within the class implementation file?
In general what are the advantages and costs of using vectors rather than arrays
In what cases would you use a vector? When would you use array?
Why is a function parameter, or a function return value never const when...Leave a comment:
-
basic questions
Hi, I would like to know some answers of some basic questions. I am working on linux
1)What are the advantages/disadvantages of commands at the console promp compared to using GUI programs?
2) When does the header file get compiled?
3)What is the output of the compilation stage?
4) what does a cin.ignore() command do?
5)In general what is the role of “const” -
ok in the main function where object of Shapefactory is called, after its function returns a new shape, i need to read the file from the line where the shape's coordinates are described.
Using the stream operator of the specific shape i hv to read the rest of the file from the pace where it says " draw Point <50 50>" and output this to the .bmp file using the 'draw()' function.
Here is a description...Leave a comment:
-
-
Help!
file to read from points.vec, its format is described in the very first post . But just to say it again, Point- shape to make,<50 145> - <x,y>
Code:image BMP 300 300 colour <255 50 0> draw Point <50 145> draw Point <50 155> colour <255 52 0> draw Point <52 145> draw Point <52 155> colour
Leave a comment:
-
Also in the following code generates some errors too
[code=cpp]
#include "ShapeFactory.h "
//Function return newShape
Shape *ShapeFactory:: getShape(const std::string &in)
{
if(in == "Point")
return new Point;
if(in == "Line")
return new Line;
//if(in == "polygon")
...Leave a comment:
-
Problem solved, the name of the file was "Makefile" and the target was to "makefile", so just had to change that........... ...
I am trying to read from a file and pass the values to their respective classes.
[code=cpp]
int main(void)
{
int width, height,red, green, blue;
//Declare filename variable
string inVec;
...Leave a comment:
-
Thanks WFC that worked perfectly well !!
OK now when i compile the whole project in linux I get this error in the shell
gccmakedep -- -Wall -pedantic-errors -g -- Rectangle.cc Bitmap.cc Image.cc Shape.cc ShapeFactory.cc Point.cc Line.cc FilledRectangle .cc Vector.cc
make: *** No rule to make target `Makefile', needed by `vector.exe'. Stop.
any idea what it means? i cant make head or tail...Leave a comment:
-
ok going ahead, I have done as WFC said and finished quite a lot.
Now I am getting errors in a particular file regarding functions.
[code=cpp]
#ifndef SHAPEFACTORY_H
#define SHAPEFACTORY_H
#include <iostream>
#include <fstream>
#include "Shape.h"
#include "Point.h"
//#include "Polygon.h"
#include "Rectangle. h"...Leave a comment:
-
well I do hv the syntax to create BMP files write pixel data into it.....
The header file-
[code=cpp]
/**
* bitmap.h
*
* Provides functionality for writing pixel data to an ostream
* in .bmp format.
*
*/
#ifndef BITMAP_H
#define BITMAP_H
#include <ostream>
/**
* Represents a colour.
*/
...Leave a comment:
-
so i modified a bit of my coding in the class image and here is what i have got so far
[code=cpp]
#ifndef IMAGE_H
#define IMAGE_H
#include <iostream>
#include "bitmap.h"
class Image
{
friend std::istream &operator >> (std::istream &input, Image &img );
{
ifstream inFile("polygon s.vec"); // opens the file...Leave a comment:
-
Bitmaping from files
I want to create a class from a file which
1) has parameters width and height.
2) Stores pixel data in dynamically allocated 2-dimensional array
3)By default all pixel colours are black (red, green and blue
values equal to 0).
This is the file
Code:image BMP 300 300 colour <255 0 0> draw Polygon 3 <10 10> <10 90> <90 10> colour
-
Give it a try, write ur variables,
use the switch statement and don't forget to store the digits after the switch statement.
Also remember that A=10, B=11 C=12 and so on , so u would hv to convert(represe nt) these values b4 the switch statement in variables of A , B, C
And get the input from the user in a string rather than a double
I am not so good at this but hope u can do something and then...Leave a comment:
-
and i dont like the language of love(the way girls think, no offense)
If there is something more difficult to understand, than one woman, its two women at the same time!!!!Leave a comment:
-
Once u go there, come back and start asking for help again.......... .....give it a try by urself , if not then post ur problems here as to what u dont understand or if u dont know c at all , and u will be helped it....Leave a comment:
No activity results to display
Show More
Leave a comment: