void main????

This is a discussion on void main???? within the C# Programming forums, part of the General Programming Boards category; Hi, I just downloaded the SharpDevelop (from Ken's link in the sticky post with all the links) I created my ...

  1. #1
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744

    void main????

    Hi,

    I just downloaded the SharpDevelop (from Ken's link in the sticky post with all the links)
    I created my first hello applicatoin. Well, the wizard did, I didn't do anything. And I noticed that it says void Main.
    Is this normal with C#?
    My guess is not because the OS still will expect an integer as return value.
    So is the wizard wrong or am I ?
    Code:
    using System;
    
    class MainClass
    {
    	public static void Main(string[] args)
    	{
    		string test;
    		Console.WriteLine("Hello World!");
    		test=Console.ReadLine();
    		Console.WriteLine(test);
    	}
    }
    Also, what book do you recomend? nvoigt posted some great links (thanks nv ), but what about books? I'm not that good with learning from tutorials, I need a books to learn something


    thanks

    --Maes
    Last edited by maes; 10-01-2003 at 05:24 AM.
    SVG is the future

  2. #2
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970
    Your program is fine. C# uses public static void Main. Microsoft 'borrowed' it from Java.

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,138
    Yes, your IDE is right about that... public static void /*puke*/ main

    What books will be helpful highly depends on what you want to do. Petzold has a book out that's called "Programming Microsoft Windows with C#". Pretty nice if you want to do GUI stuff, but not the type of bible the C/C++ book used to be. "Inside C#" from Microsoft press is good if you already know C++ or Java and just need to know how to transfer your knowledge to another syntax and it's quirks. "C# Essentials" from O'Reilly is a cheap but ok book to look things up if you already have a keyword to look for.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744

    Thumbs up

    thx for the advice guys
    SVG is the future

  5. #5
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    I just ordered the Petzold book.
    the bookstore made an error instead of pricing it at 75 (price of the translated dutch book) they've put 20 on it . I think by law they have to sell it at the price they advertise it.
    I think I made a good deal here .
    I don't have it yet, I just ordered it, I hope they'll keep their part of the deal.


    Lucky me.


    Anyway, this conlcudes my funny story for today
    SVG is the future

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2009, 09:25 AM
  2. can someone help me with these errors please code included
    By geekrockergal in forum C Programming
    Replies: 7
    Last Post: 02-10-2009, 01:20 PM
  3. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  4. need help with handelling multiple source files
    By DarkMortar in forum C++ Programming
    Replies: 38
    Last Post: 05-26-2006, 10:46 PM
  5. getting a headache
    By sreetvert83 in forum C++ Programming
    Replies: 41
    Last Post: 09-30-2005, 05:20 AM

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