:( why dont it work

This is a discussion on :( why dont it work within the C++ Programming forums, part of the General Programming Boards category; #include <iostream.h> //------------------------------------------------------------------------------ void Spaces(int &spaces) /* Set leading spaces before the '*' */ { for(int count=0; count<=spaces; count++) cout<<" ...

  1. #1
    Unregistered
    Guest

    :( why dont it work

    #include <iostream.h>

    //------------------------------------------------------------------------------
    void Spaces(int &spaces)
    /* Set leading spaces before the '*' */
    {
    for(int count=0; count<=spaces; count++)
    cout<<" ";
    }
    //------------------------------------------------------------------------------
    void DrawBar(int &sizeofrow,int spaces)
    /* Display a bar of '*' of a set increasing lenght */
    {
    Spaces(spaces);
    for(int count=0; count<=sizeofrow; count++)
    cout<<"*";
    cout<<endl;
    }
    //------------------------------------------------------------------------------
    void Isotriangle(int columns)
    /* Build the triangle and set size of bars */
    {
    int count=0;
    int sizeofrow=1;
    int count2=0;

    while(count!=columns)
    {
    count++;
    count2++;

    if (count2!=1)
    {
    sizeofrow=sizeofrow+2;
    }

    DrawBar(sizeofrow, columns);
    }
    }
    //------------------------------------------------------------------------------
    int main()

    {
    int columns;

    cout<<"Enter the number of rows you want for your triangle: ";
    cin>>columns;

    Isotriangle(columns);
    cout<<endl;

    return (0);
    }

  2. #2
    Ted
    Ted is offline
    Registered User
    Join Date
    Aug 2001
    Posts
    52
    So what about it don't work?

    The only problem I see is that you are off by one. Other than
    that it seems to work just fine.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strcmp returning 1...
    By Axel in forum C Programming
    Replies: 12
    Last Post: 09-08-2006, 08:48 PM
  2. getline() don't want to work anymore...
    By mikahell in forum C++ Programming
    Replies: 7
    Last Post: 07-31-2006, 11:50 AM
  3. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 11:39 PM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM
  5. DLL __cdecl doesnt seem to work?
    By Xei in forum C++ Programming
    Replies: 6
    Last Post: 08-21-2002, 05:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21