Search:

Type: Posts; User: xion

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    3,665

    add linked list item to the top

    ive been at this for a while now trying to understand the logic of adding an item to the top/beginning of a linked list.



    //////////////////////////////////////////
    struct link //one...
  2. Thread: Newbie question

    by xion
    Replies
    13
    Views
    1,409

    >Do I just call the funtion like this function()...

    >Do I just call the funtion like this function() or will have to to write ans in the front like this funtion(ans) so it know I want the value in "ans".

    after the function call "ans" already has a...
  3. Replies
    4
    Views
    1,154

    thanks for the tips. ill keep that in mind.

    thanks for the tips. ill keep that in mind.
  4. Replies
    4
    Views
    1,154

    so basically if the function is only going to be...

    so basically if the function is only going to be run once per object define it outside of the class?
  5. Replies
    4
    Views
    1,154

    destructor(): in and out of class differences?

    is there a difference between having a destructor in or out of the class? which one is better? having the destructor inside the class seems more readable. but my book seems to have the destructor...
  6. Replies
    8
    Views
    1,814

    the book says to use pointer notation wherever...

    the book says to use pointer notation wherever possible. but yes. it is ugly.
  7. Replies
    8
    Views
    1,814

    lol thanks guys. didnt read carefully. toupper...

    lol thanks guys. didnt read carefully. toupper returns a character that has been converted. DAMMIT! details xion...details!~!~~!



    void upit() //convert to uppercase if necessary
    {...
  8. Replies
    8
    Views
    1,814

    my upit() using toupper() in cctype.h

    cant get my upit() function to work! cant find anything wrong.


    #include<iostream>
    #include<cctype>
    #include<cstring>
    using namespace std;

    class String //user-defined string type
    {
  9. Thread: linked list logic

    by xion
    Replies
    4
    Views
    4,216

    thanks guys. got it.

    thanks guys. got it.
  10. Thread: linked list logic

    by xion
    Replies
    4
    Views
    4,216

    linked list logic

    im finally at the chapter that deals with linked lists. and to me, its confusing. i cant grasp exactly whats going on here. heres the code from the book that im trying to understand...


    ...
  11. Replies
    6
    Views
    11,542

    wow. thanks for taking the time to explain ALL...

    wow. thanks for taking the time to explain ALL that. :) got it.
  12. Replies
    6
    Views
    11,542

    thanks for the informative reply. i did some...

    thanks for the informative reply. i did some searching on the differences between stack and heap and i just want to make sure i got this right. i edited my first post to include the class person. ...
  13. Replies
    6
    Views
    11,542

    array of pointers to objects

    on declaring an array of pointers to objects does the program allocate memory for 100 persons, or only allocates them upon

    persPtr[n] = new person;
    ? having a hard time understanding the...
  14. Replies
    3
    Views
    1,420

    public/private inheritance

    my book explains that


    class C: public A //able to access public member functions
    class B: private A //un-able to access public member functions


    isnt the point of inheritance is to add...
  15. Thread: operator int()

    by xion
    Replies
    6
    Views
    1,523

    thanks for the reply.:D why is it required to...

    thanks for the reply.:D
    why is it required to convert it to long double and check the bounds?
  16. Thread: operator int()

    by xion
    Replies
    6
    Views
    1,523

    operator int()

    the book im reading has an exercise to make a class Int and overload the basic operators. there is 2 things i dont understand. it asks for bounds checking, but i dont know why the answer in the...
  17. Replies
    6
    Views
    1,368

    f is coming up negative, found a way using exit()...

    f is coming up negative, found a way using exit() in stdlib.h :) thanks guys
  18. Replies
    6
    Views
    1,368

    the book im following hasnt discussed exceptions...

    the book im following hasnt discussed exceptions yet. is there, perhaps, another way? thanks for the reply though :)
  19. Replies
    6
    Views
    1,368

    returning error on if/else in function

    i overloaded the operator '-' to subtract 2 Distances. i dont want to accept negative distance so how do i exit the function? i tried "return -1;" but the return type is of type Distance. do i...
  20. Thread: itoa explanation?

    by xion
    Replies
    6
    Views
    3,534

    so what will (3 % 10) + '0' = ? 0 right? it...

    so what will
    (3 % 10) + '0' = ?

    0 right? it doesnt even divide let alone have a remainder.
  21. Thread: itoa explanation?

    by xion
    Replies
    6
    Views
    3,534

    thanks for the responses but still somewhat...

    thanks for the responses but still somewhat puzzled.
    i edited my first post and added a main function where itoa's n = 30. given that n has the value of 30 im trying to step through the code but it...
  22. Thread: itoa explanation?

    by xion
    Replies
    6
    Views
    3,534

    itoa explanation?

    im having trouble understanding the code in itoa's do while loop. why is this finding the remainder of dividing n by 10 and adding '0'? and the condition while((n/=10)!=0). whats happening here?
    ...
  23. Replies
    1
    Views
    1,164

    conversion from different classes

    before any one tells me that this its bad to do this or its dangerous..ive already heard it on IRC and didnt get an answer that probably would've took them 10 seconds to answer than have a big...
  24. Replies
    17
    Views
    4,414

    i have robert lafore's object-oriented...

    i have robert lafore's object-oriented programming in C++. i had no experience in C++ and it starts you out quite nicely. the exercises are nice, states clearly what the book wants you to code. ...
  25. Replies
    10
    Views
    2,084

    thanks prelude, overlooked that MTF var. for...

    thanks prelude, overlooked that MTF var. for some reason it thought that variable was declared and defined at the same time. :)

    p.s. i been switching back and forth through c++ and c. k&r is...
Results 1 to 25 of 63
Page 1 of 3 1 2 3