Search:

Type: Posts; User: fairguynova

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    728

    Ok, I got it. The real problem was in main...

    Ok, I got it. The real problem was in main 'sales' instead of 'Sales'...
  2. Replies
    3
    Views
    728

    My thing is the solution code looks the same in...

    My thing is the solution code looks the same in terms of the location of the QUARTERS constant.
  3. Replies
    3
    Views
    728

    Error in Dev C++...

    #ifndef SALES_H_
    #define SALES_H_

    namespace SALES {

    const int QUARTERS = 4;
    class Sales {
    private:
    double sales[QUARTERS];
    double average;
  4. Replies
    153
    Views
    217,080

    Sticky: RAmen!:)

    RAmen!:)
  5. Replies
    10
    Views
    923

    Ok, I did not fix everything. How can I get the...

    Ok, I did not fix everything. How can I get the following function to return an address for the longest string int the array of char*:


    template <> char* maxn(char* ar[], int n) {
    using...
  6. Replies
    10
    Views
    923

    I fixed it, and the code now compiles. Thanks.

    I fixed it, and the code now compiles. Thanks.
  7. Replies
    10
    Views
    923

    Ok, I changed the return type to char*, but now I...

    Ok, I changed the return type to char*, but now I am getting the following errors:
    [Linker error] undefined reference to `int maxn<int>(int*, int)'
    [Linker error] undefined reference to `double...
  8. Replies
    10
    Views
    923

    Here is the entire code: //prototypes...

    Here is the entire code:


    //prototypes
    template <class Any>
    Any maxn(Any ar[], int n);

    template <> Any maxn(char ar[], int n);

    int main() {
  9. Replies
    10
    Views
    923

    I am trying to create a specialization for the...

    I am trying to create a specialization for the pointer-to-char type.
  10. Replies
    10
    Views
    923

    Help with template specialization

    Can someone else help spot what is wrong with the following code:


    //prototypes
    template <class Any>
    Any maxn(Any ar[], int n);

    template <> Any maxn(char* ar[], int n);

    Here are the...
  11. Replies
    5
    Views
    1,392

    Ok, I think my explaination was wrong, but it...

    Ok, I think my explaination was wrong, but it works...
  12. Replies
    5
    Views
    1,392

    Thanks for your help. I realize that when I was...

    Thanks for your help. I realize that when I was passing in a pointer-pointer into a function that expects a pointer.

    The line: box * ptr = new box [num_boxes];

    I forgot that ptr was already a...
  13. Replies
    5
    Views
    1,392

    The thing that gets me is that the programs works...

    The thing that gets me is that the programs works the first time trough the loop (let us say the number of boxes is 2).
  14. Replies
    5
    Views
    1,392

    Dynamic Array of Structs help

    Hi, I am new here first off.

    Second, I need help debugging code. This program asks the user for the number of boxes. Then, it creates an array of box structs equal to the number specified by the...
Results 1 to 14 of 14