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


Newest CodeGuru.com Articles:

  • Deploying Windows Server 2008 with System Center
  • Remote Desktop Protocol Performance Improvements in Windows Server 2008 R2 and Windows 7
  • The Microsoft Dynamics CRM Security Model
  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old November 22nd, 2009, 08:32 PM
    LilProblems LilProblems is offline
    Junior Member
     
    Join Date: Nov 2009
    Location: Corona Ca
    Posts: 2
    LilProblems is an unknown quantity at this point (<10)
    HELP this is not going well

    Here is my code. It is supposed to draw 2 triangles - one with asterisks and one with characters. At first one triangle built, now none of them do. Will somebody please explain this to me?
    Reply With Quote
      #2    
    Old November 22nd, 2009, 08:35 PM
    LilProblems LilProblems is offline
    Junior Member
     
    Join Date: Nov 2009
    Location: Corona Ca
    Posts: 2
    LilProblems is an unknown quantity at this point (<10)
    Re: HELP this is not going well

    Quote:
    Originally Posted by LilProblems View Post
    Here is my code. It is supposed to draw 2 triangles - one with asterisks and one with characters. At first one triangle built, now none of them do. Will somebody please explain this to me?

    #include <iostream>
    using namespace std;
    void printTriangle(int);
    void drawBar(int,int);
    void drawBar(double,char);

    int main()
    {
    int size;
    cout << "This program draws a Triangle" << endl;
    cout << "\nEnter the triangle base size: ";
    cin >> size;
    printTriangle(size);
    } //main

    void printTriangle(int sz)
    {
    for(int i = 0; i <= sz; i++)
    {
    drawBar(i,sz);
    }
    cout << endl;

    for(double i = 0; i <= sz; i++)
    {
    cout << "Enter a character: ";
    cin >> sz;
    }
    drawBar(double, sym)
    cout << endl;
    }

    }
    void drawBar(double ss,char symbol)
    {
    for( double i = 0; i <= ss; i++)
    {
    cout << "symb";
    }
    } // drawBar
    void drawBar(double ssz,char symb)
    {
    for(double i = 0; i < ssz; i++)
    {
    cout << "symb";
    }
    }// drawBar
    Reply With Quote
      #3    
    Old November 23rd, 2009, 03:53 AM
    Skizmo's Avatar
    Skizmo Skizmo is online now
    Elite Member
     
    Join Date: Sep 2004
    Location: Holland (land of the dope)
    Posts: 2,822
    Skizmo is a name known to all (1000+) Skizmo is a name known to all (1000+) Skizmo is a name known to all (1000+) Skizmo is a name known to all (1000+) Skizmo is a name known to all (1000+) Skizmo is a name known to all (1000+) Skizmo is a name known to all (1000+) Skizmo is a name known to all (1000+) Skizmo is a name known to all (1000+)
    Re: HELP this is not going well

    Code:
    drawBar(i,sz);
    sz is the size, not a symbol.

    Code:
    cout << "symb";
    Why are you printing the text 'symb' ?
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:55 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.