473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Why we don't include Main() in namespace definition?

1
Why we don't include Main() in namespace definition? If we use Main() in namespace then will that cause any error?
Aug 20 '10 #1
1 1071
Plater
7,872 Expert 4TB
What are you refering to?
Main is generally in the namespace.
The default looks like:
Expand|Select|Wrap|Line Numbers
  1. namespace myProjectName
  2. {
  3.     static class Program
  4.     {
  5.         /// <summary>
  6.         /// The main entry point for the application.
  7.         /// </summary>
  8.         [STAThread]
  9.         static void Main(string[] args)
  10.         {
  11.         }
  12.     }
  13. }
  14.  
Which could be referenced by myProjectName.Program.Main(new string[0])
Aug 31 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: insane79 | last post by:
Hi, i have one problem with an xsl trasformation (I'm using Xalan) The source XML document is the following: <?xml version = '1.0' encoding = 'ISO-8859-1'?> <ROOT...
27
by: poiuz24 | last post by:
aeh, this may be stupid, but could s.b. please explain to me why the following won't link (gcc 3.3)? foo.cpp = """ namespace foo { int main () { return 0; }
8
by: Petter Reinholdtsen | last post by:
I ran into a problem on HP-UX 11.00 the other day, where it refused to compile a program using 'using namespace std;' at the top. The reason seem to be that the compiler refuses to accept 'using...
2
by: puzzlecracker | last post by:
after reading some of the post I found out something rather radical to my previous understanding: that when you do #include<iostream> #include<string> #include<vector> etc compiler puts...
2
by: Tony Johansson | last post by:
Hello! I'm reading a book about C++ and there is something that I don't understand so I ask you. Below I have the text from the book and the code from the file where main is located and some...
0
by: John | last post by:
Hi, I'm creating a component to generate a schema file much like VS generates for DataSets. I'm using XmlSchema to do the job and I also am using a XmlNamespaceManager to manage namespaces. ...
0
by: DM | last post by:
Hello. MSDN states that XML comments can be placed before a namespace definition. But when I try it compiler gives me "XML comment in not place on a valid language element" warning. My code...
2
by: garyusenet | last post by:
static void Main(string args) { } If you know your programme will not take any string arguments, would it make any difference at all if you removed the string arguments from the code? And had...
6
by: Soorali | last post by:
Hi I am a newbie to VC++ and this is my first independent project so please pardon my ignorance!! My project compiles and runs perfectly fine in Debug mode. However, when I try to compile it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.