User Profile

Collapse

Profile Sidebar

Collapse
QiongZ
QiongZ
Last Activity: Dec 15 '09, 05:22 AM
Joined: Nov 13 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • QiongZ
    replied to Question about arrays and pointers, please help
    in C
    Thanks a lot Banfa for taking time to explain in detail. Also you explained it in a way very easy to understand.

    Every time I post here, I get excellent answers. I can't thank you guys enough.

    Qiong
    See more | Go to post

    Leave a comment:


  • QiongZ
    replied to Question about arrays and pointers, please help
    in C
    Thanks everyone and what a great post, weaknessforcats !

    Now I understood

    double (*balance)[6] = new double[10][6];

    but still don't know what

    Code:
    double** balance = new double* [10];
    means in C++?

    In your article, you said

    Code:
    double** balance = new double [10][6];
    would be error.

    Is

    Code:
    new double [10][6];
    equivalent...
    See more | Go to post

    Leave a comment:


  • QiongZ
    started a topic Question about arrays and pointers, please help
    in C

    Question about arrays and pointers, please help

    I came across this when I was reading a book on Java.

    In the book, there is a note trying to explain what's equivalent in C++ to

    Code:
    double[][] balance = new double[10][6];  // Java
    So my question is what's the difference between

    Code:
    double balance[10][6];
    and
    Code:
    double (*balance)[6] = new double[10][6];
    and

    Code:
    double** balance = new double*
    ...
    See more | Go to post

  • QiongZ
    replied to linked list template class doesn't compile
    in C
    The problem is solved. Someone suggested me to add

    Code:
    template< typename T > class List1;
    in listnd.h before declaration of ListNode.

    And also I did the following two things:

    1 took destructor ~ListNode() out of listnd.h
    2. make sure all the typename (for class List1 and class ListNode) same


    that did the trick.

    Thank you very much for your...
    See more | Go to post

    Leave a comment:


  • QiongZ
    replied to linked list template class doesn't compile
    in C
    Thank you very much for your reply. I made a few changes you suggested. I put templates all in header files and I am listing them again so that it is easy to see on which lines the errors occurred.

    linked-list-driver.cpp
    Code:
    // linked-list-driver.cpp : Defines the entry point for the console application.
    //
    
    //#include "stdafx.h"
    #include <iostream>
    #include "list1.h"
    ...
    See more | Go to post

    Leave a comment:


  • QiongZ
    replied to linked list template class doesn't compile
    in C
    C++ How to program by Deitel and Deitel.

    What kind of errors? Can you point out some of them for me? Thank you for your reply.

    One thing to note again: if I remove all the templates, the program compiled successfully.

    Qiong
    See more | Go to post

    Leave a comment:


  • QiongZ
    started a topic linked list template class doesn't compile
    in C

    linked list template class doesn't compile

    Hi, I just recently started studying C++ and basically copied an example in the textbook into VS2008, but it doesn't compile. I tried to modify the code by eliminating all the templates then it compiled no problem. But I can't find the what the problem is with templates? Please help. The main is in test-linked-list.cpp. There are two template classes. One is List1, the other one is ListNode. The codes are below:


    Code:
    // test-linked-list.cpp
    ...
    See more | Go to post
No activity results to display
Show More
Working...