I'm trying to learn how to do a prototype function and this is what is in a C++ book. I typed it out in Visual Studio, but it doesn't seem to work.
any ideas why?
Code://draws a triangle void drawTriangle() { drawIntersect(); drawBase(); } // File: stickFigure.cpp // Draws a stick figure #include <iostream> using namespace std; // Fucntions used ... void drawCircle(); // Draws a circle void drawTriangle(); // Draws a triangle void drawIntersect(); // Draws intersecting lines void drawBase(); // Draws a horizontal line int main() { // Draw a circle. drawCircle(); // Draw a triangle drawTriangle(); // Draw intersecting lines. drawIntersect(); return 0; } // Draw a circle void drawCircle() { cout << " * " << endl; cout << " * * " << endl; cout << " * * " << endl; } // end drawCircle // Draws a triangle void drawTriangle { drawIntersect(); drawBase(); } // end drawTriangle // Draws intersecting lines void drawIntersect() { cout << " /\\ " << endl; cout << " / \\ " << endl; cout << " / \\ " << endl; } // end drawIntersect //Draws a horizontal line void drawbase() { cout << " _ _ _ _ _ _ " << endl; } // end drawbase



LinkBack URL
About LinkBacks


