Search:

Type: Posts; User: stewie griffin

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    2,124

    if you dont specify anything else it will by...

    if you dont specify anything else it will by defualt look for a variable named CPPFLAGS
  2. Replies
    4
    Views
    2,124

    maybe replace CFLAGS = -O3 with ...

    maybe replace


    CFLAGS = -O3

    with


    CPPFLAGS = -g
  3. Replies
    2
    Views
    1,266

    when compiling this line of code: k=...

    when compiling this line of code:

    k= MAX(i++,++j);
    the compiler substitutes MAX with the macro you defined:


    k= ( i++ ) > ( ++j ) ? i++ : ++j
  4. Replies
    5
    Views
    1,758

    wow!! thanks..... you are the best!

    wow!!
    thanks..... you are the best!
  5. Replies
    5
    Views
    1,758

    operator

    I created complex class:



    class CComplex
    {
    private:
    double m_dReal;
    double m_dImage;
    public:
  6. Replies
    15
    Views
    2,745

    I'm working in Unix....

    I'm working in Unix....
  7. Replies
    15
    Views
    2,745

    Can't use STL..... this was my class...

    Can't use STL.....

    this was my class declaration (Drawing.H):


    class Drawing{
    private:
    shape** drawing_;
    int size_;
    public:
  8. Replies
    15
    Views
    2,745

    I think I solved it. I moved the implementation...

    I think I solved it.
    I moved the implementation to the .C file and it worked.....
  9. Replies
    15
    Views
    2,745

    constructor problem

    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...
  10. Replies
    12
    Views
    2,296

    well couple of days ago I tried something like...

    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)...
  11. Replies
    12
    Views
    2,296

    As I said, each derived class has its overloaded...

    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...
  12. Replies
    12
    Views
    2,296

    I don't know the reason for this...

    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...
  13. Replies
    12
    Views
    2,296

    and what if I can't use virtual functions...

    and what if I can't use virtual functions (exercise restrictions)?
  14. Replies
    12
    Views
    2,296

    At first I didn't use switch: ostream&...

    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 <<...
  15. Replies
    12
    Views
    2,296

    polymorphism and inheritance

    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...
  16. Replies
    6
    Views
    1,859

    for(n=1;n

    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;
  17. Replies
    6
    Views
    2,634

    thanks a lot !!! it worked..... how can you...

    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?)
  18. Replies
    6
    Views
    2,634

    I attached the files... I work in unix...

    I attached the files...
    I work in unix enviroment so i attached also the makefile....
    not so sure it will work in windows....
  19. Replies
    6
    Views
    2,634

    ok i changed the malloc: name =...

    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...
  20. Replies
    6
    Views
    2,634

    C-string problem in linked lists

    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...
Results 1 to 20 of 20