Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. grscot

    I cant' display book and borrower's details

    Dear all, I'm still struggling to display the book and the borrower's details together. Could someone help me? regards, grscot
  2. grscot

    I cant' display book and borrower's details

    Not really, I don't know how to use the debugger. grscot
  3. grscot

    I cant' display book and borrower's details

    <pre> Dear all, I can't borrow a book even though the code does not have any error. When I try to display the book details along with the member's name (in case the member has borrowed the book), I can't display the member's name, but only the book details and a message: &quot;no member has...
  4. grscot

    Can't display items from an array

    Dear all, All I'm trying to do is to enter 3 books from the keyboard to an array and then traverse the array to display the elements and also prompt the user to enter the book names to delete them from the array(if the book exists into the array). The code that adds to the array is...
  5. grscot

    Question abou templates

    Please do not be bothered any more with this question. I have posted a new one under the title: 'Can I use 1 template function instead of 2?' grscot
  6. grscot

    Can I use 1 template function instead of 2?

    Dear all, I have two template functions for displaying books and members respectively from arrays. template<class Object> void List<Object>::displayBook(char* type) { if (num_elements == 0) cout<<&quot;No &quot;<<type<<&quot; is found in the &quot;<<type<<&quot; array.\n&quot;; else...
  7. grscot

    Template again

    Instead of having two functions, to display the members from the member array and the books from the book array, I have to use one template function to perform both operations(if this is possible). I don't know if this is possible, so that is why I'm posting my problems. Regards, grscot
  8. grscot

    Template again

    Dear all, The only reason I posted the whole code was to give one the chance to run the program and see in practice the problem. But I guess you are right, that is too much. Anyway, The implementation of the two functions is: //It returns the member. Member*...
  9. grscot

    Template problem

    Dear all, The concept behind the code is: There is an associationlist that holds association pointers. Each association pointer has two pointers, that point to a book and to a member object respectively. Now what I'm trying to do is: To have the association pointer to use its two pointers to...
  10. grscot

    Template problem

    Dear all, The concept behind the code is: There is an associationlist that holds association pointers. Each association pointer has two pointers, that point to a book and to a member object respectively. Now what I'm trying to do is: To have the association pointer to use its two pointers to...
  11. grscot

    Question abou templates

    Dear all, I have two functions: a) Member* get_member(Book* book); b)Book* get_book(Member* member); The implementation code for the function prototypes is: a) template<class Book,class Member> Member* AssociationList<Book,Member>::get_member(Book* book) { Member* member=0; bool...
  12. grscot

    Template question

    Dear all, I have two functions: a) Member* get_member(Book* book); b)Book* get_book(Member* member); The implementation code for the function prototypes is: a) template<class Book,class Member> Member* AssociationList<Book,Member>::get_member(Book* book) { Member* member=0; bool...
  13. grscot

    More template problems

    Dear all,I'm really sorry for asking again about the same thing, but I don't really undersatnd what's going on with the templates. I've tried to use the template<class R, class P> R* get_member(P* pArg) as adviced, but it seems that my program is more complicated. So, I...
  14. grscot

    Another template question

    Dear all, I 've understood that the template function for the two functions : int AddNumbers(int a, int b); float AddFloats(float a, float b); is: template<class T> T Add(const T &a, const T&b) { return a+b; } because the arguments' return type is the same as the functions' return type...
  15. grscot

    Template question problem

    Dear all, I would like to ask if it is possible to have a template function as a general function for two functions that have a different return type. For example: int AddNumbers(int a, int b); float AddFloats(float a, float b); What would it be the template function for the above example...
  16. grscot

    Can't use template function to do two similar things(display member,bo

    Dear all, In the menu, I can add members in a memberlist and display them, using the function : template<class Object> void List<Object>::displayElement(char* type) { if (num_elements == 0) cout<<&quot;No &quot;<<type<<&quot; is found in the &quot;<<type<< &quot;array.\n&quot;; else for(int...

Part and Inventory Search

Back
Top