if you dont specify anything else it will by defualt look for a variable named CPPFLAGS
Type: Posts; User: stewie griffin
if you dont specify anything else it will by defualt look for a variable named CPPFLAGS
maybe replace
CFLAGS = -O3
with
CPPFLAGS = -g
when compiling this line of code:
k= MAX(i++,++j);
the compiler substitutes MAX with the macro you defined:
k= ( i++ ) > ( ++j ) ? i++ : ++j
wow!!
thanks..... you are the best!
I created complex class:
class CComplex
{
private:
double m_dReal;
double m_dImage;
public:
I'm working in Unix....
Can't use STL.....
this was my class declaration (Drawing.H):
class Drawing{
private:
shape** drawing_;
int size_;
public:
I think I solved it.
I moved the implementation to the .C file and it worked.....
As a part of an exercise I need to built Drawing class that contains an array
of pointers to objects from other classes (different types of shapes)
I have a few problems with the constructor.
at...
well couple of days ago I tried something like this:
case _line:
os << static_cast<Line>( drw.drawing[i] ); break; and It didn't work....
but when I tried now your code (with a minor change)...
As I said, each derived class has its overloaded operator<<
I thought that when calling cout<<drw.drawing[i] the correct operator would be called
but something here is wrong....
And I...
I don't know the reason for this restriction......
anyway, when using static_cast I got the following error:
no matching function to call Line::Line(shape&)
so I guess I need to build a...
and what if I can't use virtual functions (exercise restrictions)?
At first I didn't use switch:
ostream& operator << (ostream& os, const Drawing& drw)
{
for(int i=0; i<drw.size_;i++)
if (!(drw.drawing_[i].is_empty()))
os <<...
hi
I have a base class called shape and 3 drived classes: line, rect, circle.
in addition I have drawing class that contins array of shape*.
I successfully overloaded opertor << for line, rect...
for(n=1;n<=20;n++)
{
x[tau[n]]=pow(e,-tau[n]);
x[tau[n-1]]=pow(e,-tau[n-1]);
A=x[tau[n]]-x[tau[n-1]];
B=tau[n]-tau[n-1];
C=A/B;
if(C<0)
C=-C;
D=C+1;
thanks a lot !!!
it worked.....
how can you explain the why only a specific string in the list was changed?
(no matter where in the list it was?)
I attached the files...
I work in unix enviroment so i attached also the makefile....
not so sure it will work in windows....
ok i changed the malloc:
name = malloc(sizeof(char *) * (strlen(temp->name)+1));
didn't help....
the strange thing is that after the first time the malloc was executed,
every string in the...
hi,
I have a linked list of struct that contains string and int.
(name and price) the list is sorted by price (ascending order)
i built a function that returns the name of a product by its place...