473,383 Members | 1,862 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,383 software developers and data experts.

does C# have statement like include in C?

I have a C# source code need to share between different programs, does C#
have statement like include in C?
Nov 16 '05 #1
3 8121
"sincethe2004" <si**********@asd.com> wrote:
I have a C# source code need to share between
different programs, does C# have statement like
include in C?


The normal way of accessing one project's classes from another is to
add a reference to the shared project or its DLL.

If you just want to share a single file, add it to the project but
choose "Link" instead of "Open" (by clicking the dropdown arrow on
that button). Both projects will use the same copy of the file.

P.
Nov 16 '05 #2
Hi Paul
You should add the source code file to the project where you
want to use it , if the place where you will use your source file belong to
the same namespace , you go ahaid and simply call what ever you want to
call or declare what ever type of that file . if it is inside a different
namespace you simply use fill qualifiers or just add a using statement .
again you need to add that source file to the project you are working in.
hope that helps
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #3

There is no "include" statement in c# like C++. C# goes by namespaces. To
get access to the libraries, "using TestNamespace" will get the access
(reference has to be added first) of the classes.

--
Shak
(Houston)
"sincethe2004" <si**********@asd.com> wrote in message
news:ed**************@TK2MSFTNGP12.phx.gbl...
I have a C# source code need to share between different programs, does C#
have statement like include in C?

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jay | last post by:
G'day all This registration form checks for the submit button then displays the next form from the include statement. But before it displays the next form it will check to make sure the user...
0
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the...
44
by: Bamber | last post by:
Why does f get returned ? (compiled with gcc). #include<stdio.h> int func(int a); main() { int f; f=func(7); printf("f=%d",f);
6
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file =...
2
by: mikelinyoho | last post by:
Does the following program architecture make sense? #include <stdio.h> #include "test1.c" #include "sample.cpp" int main(void){ output();
6
by: Matt Kowalczyk | last post by:
Hello, Can someone explain to me why the following code works correctly? It would seem like it shouldn't. irc_client.c contains: #include "ircclient.h IRCClient* init_irc_client() {
18
by: sunny | last post by:
Hi Why does C allows declaration of variable inside switch block. ex: foll prg does not gives "undeclared "b" error msg. but also does not initialize b to 20 int a=1; switch(a) { int b=20;...
12
by: Sheldon | last post by:
#define UWORD2 unsigned short int typedef BYTE Boolean; Boolean evaluateBit(UWORD2 *value, int bitnumber); Boolean evaluateBit(UWORD2 *value, int bitnumber) { int one=1; return (one &(*value...
0
by: pkolinko | last post by:
Hi everyone, I am writing a small low level embedded USB application using C++/CLI windows Forms. I am sort of new to the C++/CLI and having trouble understanding what happens in this very...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.