C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2722
Number of posts: 5749

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
My first OOP bug ( please help) Posted by Zorro26 on 20 May 2009 at 2:22 PM
Here is the code:

using System;

namespace ThisOldMan
{
    class ThisOldMan
    {
        static void main(string[] args)
        {
            doVerse(1);
            doChorus();
            doVerse(2);
            doChorus();
        }// end main

        static void doChorus()
        {
            string message = "";
            message += "\n...With a knick-knack paddy whack\n";
            message += "Give a dog a bone\n";
            message += "This old man came roling home.";
            message += "\n\n";
            System.Console.WriteLine(message);
        }// end doChorus()

        static void doVerse(int verseNum)
        {
            string message = "";
            message += "This old man, he played ";
            message += verseNum;
            message += ". \nHe played knick-knack ";
            message += getPlace(verseNum);
            Console.WriteLine(message);
        }// end verse

        static string getPlace(int verseNum)
        {
            string message = "";
            switch (verseNum)
            {
                case 1:
                    message = "on my thumb ";
                    break;
                case 2:
                    message = "on my shoe ";
                    break;
                default:
                    message = "not yet defined";
                    break;
            }// end switch
            return message;
        }//end getPlace
    }// end class
}// end namespace


Here is the error message VS2008 gives me on compilation:

Error 1 Program 'C:\Users\Shalom\Documents\Visual Studio 2008\Projects\C#\Song\Song\obj\Debug\Song.exe' does not contain a static 'Main' method suitable for an entry point Song

Thanks in advance


Report
Re: My first OOP bug ( please help) Posted by Zorro26 on 20 May 2009 at 10:15 PM
I solved that already:

I have just forgot to place capital M in Main and that's all.
Thank you Google :)



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.