Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

header files

Hi all,
I am a (very)fresh men.I just started to study C# today.(But I m familiar with C++).

May be it is stupid but I wanna ask a question about Including header files.

Are there any header files like C++'s and if there r, how can we include them?

Let me make it clear.In C++ files(especially .cpp) we can write some code like
#include

and
we can use some predefined funcs like
cout<<"something";
or
cin>>t;


thanks.
Bilen

Comments

  • somethinginnovsomethinginnov Member Posts: 2
    In .NET, the CLR automatically provides most of the funnctionality you would get from the standard headers. You can add references in your project to another .NET or COM library. I'm not sure if there is a way to #include your own custom header files.


    : Are there any header files like C++'s and if there r, how can we include them?
    :
    : Let me make it clear.In C++ files(especially .cpp) we can write some code like
    : #include
    :
    : and
    : we can use some predefined funcs like
    : cout<<"something";
    : or
    : cin>>t;
    :
    :
    : thanks.
    : Bilen
    :

  • frazrasheedfrazrasheed Member Posts: 18
    Hi Bilen,

    In C++, code libraries are provided in the form of header and library files, while in C# and .Net, code libraries are provided in the form of assemblies (.dll or .exe) and are packed in namespaces. A namespace is a virtual collection of different library classes while the assemblies are the physical collection of related classes. So, instead of header files, we include namespaces to our C# programs like

    using System;

    class Test
    {
    static void Main()
    {
    System.Console.WriteLine("Hello World");
    // or because we have already included the System namespace
    Console.WriteLine("Hello World");
    }
    }


    Best Regards,
    Faraz

    : Hi all,
    : I am a (very)fresh men.I just started to study C# today.(But I m familiar with C++).
    :
    : May be it is stupid but I wanna ask a question about Including header files.
    :
    : Are there any header files like C++'s and if there r, how can we include them?
    :
    : Let me make it clear.In C++ files(especially .cpp) we can write some code like
    : #include
    :
    : and
    : we can use some predefined funcs like
    : cout<<"something";
    : or
    : cin>>t;
    :
    :
    : thanks.
    : Bilen
    :

  • BilenBilen Member Posts: 2
    Hi Faraz,
    Thanks for answer.Your article(C# school) is really great work.
    Appriciate for it, but I wanna know are there any article(s) or ebook(s) that you can suggest for us about C# to improve ourself more at C#.
    I do not mean your work is not good enough, it is (realy realy ) best online tutorial I have ever read.

    : Hi Bilen,
    :
    : In C++, code libraries are provided in the form of header and library files, while in C# and .Net, code libraries are provided in the form of assemblies (.dll or .exe) and are packed in namespaces. A namespace is a virtual collection of different library classes while the assemblies are the physical collection of related classes. So, instead of header files, we include namespaces to our C# programs like
    :
    : using System;
    :
    : class Test
    : {
    : static void Main()
    : {
    : System.Console.WriteLine("Hello World");
    : // or because we have already included the System namespace
    : Console.WriteLine("Hello World");
    : }
    : }
    :
    :
    : Best Regards,
    : Faraz
    :
    : : Hi all,
    : : I am a (very)fresh men.I just started to study C# today.(But I m familiar with C++).
    : :
    : : May be it is stupid but I wanna ask a question about Including header files.
    : :
    : : Are there any header files like C++'s and if there r, how can we include them?
    : :
    : : Let me make it clear.In C++ files(especially .cpp) we can write some code like
    : : #include
    : :
    : : and
    : : we can use some predefined funcs like
    : : cout<<"something";
    : : or
    : : cin>>t;
    : :
    : :
    : : thanks.
    : : Bilen
    : :
    :
    :

  • frazrasheedfrazrasheed Member Posts: 18
    I found Professional C# from Wrox, Programming C# from Orielly and MSDN usefull sources for self study and learned a lot from these sources

    : Hi Faraz,
    : Thanks for answer.Your article(C# school) is really great work.
    : Appriciate for it, but I wanna know are there any article(s) or ebook(s) that you can suggest for us about C# to improve ourself more at C#.
    : I do not mean your work is not good enough, it is (realy realy ) best online tutorial I have ever read.
    :
    : : Hi Bilen,
    : :
    : : In C++, code libraries are provided in the form of header and library files, while in C# and .Net, code libraries are provided in the form of assemblies (.dll or .exe) and are packed in namespaces. A namespace is a virtual collection of different library classes while the assemblies are the physical collection of related classes. So, instead of header files, we include namespaces to our C# programs like
    : :
    : : using System;
    : :
    : : class Test
    : : {
    : : static void Main()
    : : {
    : : System.Console.WriteLine("Hello World");
    : : // or because we have already included the System namespace
    : : Console.WriteLine("Hello World");
    : : }
    : : }
    : :
    : :
    : : Best Regards,
    : : Faraz
    : :
    : : : Hi all,
    : : : I am a (very)fresh men.I just started to study C# today.(But I m familiar with C++).
    : : :
    : : : May be it is stupid but I wanna ask a question about Including header files.
    : : :
    : : : Are there any header files like C++'s and if there r, how can we include them?
    : : :
    : : : Let me make it clear.In C++ files(especially .cpp) we can write some code like
    : : : #include
    : : :
    : : : and
    : : : we can use some predefined funcs like
    : : : cout<<"something";
    : : : or
    : : : cin>>t;
    : : :
    : : :
    : : : thanks.
    : : : Bilen
    : : :
    : :
    : :
    :
    :

Sign In or Register to comment.