CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: 2kaud

Page 1 of 5 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    r and h are private.
  2. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    GCDEF is quite correct. You cannot guess c++. You must understand what you are doing. You must have a grasp of the basics before you advance.

    As GCDEF said, you really need to take a step back...
  3. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    default:
    cout<<"\nThe choice entered is a wrong choice";
    cout<< "Area =" << c.area() << "\n";
    cout<< "Volume=" << c.volume() << "\n";


    So you are only going to calculate the...
  4. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    Well you're getting closer!

    In your case statements, you haven't actually called the class functions! So in case 1 for example you need



    cin>>y;
    cout << "Area is: " << c.area(x, y) << endl;
  5. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    In a class, by default all members are private - which basically means that they cannot be accessed outside of the class. This is fine for member variables like r and h, but functions such as area...
  6. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    Before posting, format your code properly with indentations etc. Then Go Advanced, paste in the code, select the code and then click '#'. To format the code you have already posted, on the bottom of...
  7. Re: Rotate_left and Rotate_right functions for a treap

    Have a look at these

    http://cplusplus.happycodings.com/Data-Structures-and-Algorithm-Analysis-in-C++/code105.html
    http://en.wikipedia.org/wiki/Tree_rotation
  8. Thread: spiral matrix

    by 2kaud
    Replies
    3
    Views
    99

    Re: spiral matrix

    If you want to use a prototype (why??) of


    void f(int *a,int m,in n);

    then a is a pointer to the first memory address where the integers are stored, and m * n is the number of integers to...
  9. Thread: spiral matrix

    by 2kaud
    Replies
    3
    Views
    99

    Re: spiral matrix

    Before posting code, please format properly with indents etc and use code tags (Go Advanced, select code and click '#').



    No it doesn't - even if it seems to!

    Your code as posted doesn't...
  10. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    Re b). Please re-read Nuzzle's post #8 re polymorphism and casting. This is probably to what your teacher is referring (albeit badly) - ie int into a double and float into a double. Hence only one...
  11. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    cout <<"Enter radius\n";
    cin>>r;
    cout <<"Enter height\n";
    cin>>h;


    Where have you defined the variables r and h??

    Also note that 3.14 * r * r is not the formula for the surface area of a...
  12. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    b)Just because the radius and height input from the keyboard can be either an integer, float or double does not mean that you require 3 different functions to calculate the area and 3 different...
  13. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    If you are going to overload a function, the compiler must be able to differentiate between the various overloaded functions to determine the one to use. Simplified, it matches the number and type of...
  14. Replies
    46
    Views
    659

    Re: Area and volume of cylinder

    Please when you post code format your code properly first and use code tags. Go Advanced, select code and click '#'. Your code is pretty unreadable without.
  15. Replies
    2
    Views
    146

    Re: Files,question about data

    If you want to read data from a file using the FILE set of functions, then you need to open the file for reading.


    fp = fopen("d.dat", "r");

    Then assuming the file contains numbers in the...
  16. Thread: return pointer

    by 2kaud
    Replies
    3
    Views
    115

    Re: return pointer

    As GCDEF said, what is the value of i at the end of your fill function? So what value are you returning from the function?



    show_array(properties, &pk);


    This passes the address of the...
  17. Re: Help request: QuickTime ActiveX Control Heap Corruption the second time I open a

    The zip file contains the code from the link.

    31445
  18. Re: Help request: QuickTime ActiveX Control Heap Corruption the second time I open a

    From your first post



    If hardcoding a valid URL in the control at compile does not cause the problem, then IMO the cause of the problem is unlikely to be the control. I would be looking at how...
  19. Re: Help request: QuickTime ActiveX Control Heap Corruption the second time I open a

    Have you checked that the contents of m_strURL.GetBuffer() are correct? What happens if you hardcode the URL as in


    m_kQtControl.put_FileName(_T("MyURL"));
  20. Re: Help request: QuickTime ActiveX Control Heap Corruption the second time I open a

    Try replacing


    m_kQtControl.put_FileName(m_strURL);

    with



    m_kQtControl.put_FileName(m_strURL.GetBuffer());
  21. Replies
    14
    Views
    324

    Re: Member function pointer assignment

    So do what Paul requested in post #11 and post a complete program that demonstrates the issue.
  22. Replies
    4
    Views
    126

    Re: Looking for chars in string.

    That's what I originally thought was required, but the output from this doesn't match the results of the given examples.
  23. Replies
    4
    Views
    126

    Re: Looking for chars in string.

    Nor to me either. I don't understand your example result numbers.
  24. Replies
    7
    Views
    171

    Re: CFileDialog::DoModal() never returns in DLL

    What exactly is the problem you are experiencing? You don't say what is the problem.
  25. Replies
    14
    Views
    324

    Re: Member function pointer assignment

    How have you used them? because it works OK for me. The following code compiles and runs with MSVS.



    #include <iostream>
    using namespace std;

    class MyClass
    {
    typedef...
Results 1 to 25 of 119
Page 1 of 5 1 2 3 4



HTML5 Development Center

Click Here to Expand Forum to Full Width