... d) interact with the operating system Which of the following is a correct statement to declare the class “MyClass”? a) Class myclass c) class MyClass b) class Myclass d) Class MyClass Which of ... class Object{ static void main(){} public static Main(){} } } e) class Object{ b) class Object{ static void Main(){}; static void Main(){} } } c) Class Object{ static void Main(){} } Which of the ... program cannot compile because the for statement’s syntax is incorrect using System; class Test { static void Main() { int @Main; int[] Static= new int[3]; @Main =100*Static[1]; Console.WriteLine(@Main);...
Ngày tải lên: 21/08/2012, 15:55
... an int data type of a property Which of the following is the correct syntax for declaring an indexer a) protected int this[int var1] c) public int this(int var1) b) public int classname[int index] ... nothing How can we create the object dynamically in C# ? [2.5] a) C# does not allow instantiation c) By using the of objects at run time System.Activator CreateInstance() method to create an instance ... (myObjectType) d) In C# , Object cannot be instantiated at run time but a method of a class can be invoked [2.5] 193 using System.Reflection; using System; class Reflect { public int i=20; public char ch='a';...
Ngày tải lên: 29/08/2012, 16:37
Socket programming in C
... clntSocket); /* Error handling function */ /* TCP client handling function */ int main(int argc, char *argv[]) { int servSock; int clntSock; struct sockaddr _in echoServAddr; struct sockaddr _in echoClntAddr; ... gets a socket for an incoming client connection by calling accept () int accept(int socket, struct sockaddr *clientAddress, unsigned int *addressLength) accept() dequeues the next connection on ... new socket for each client connection Communicate with the client via that new socket using send() and recv() Close the client connection using close() Creating the socket, sending, receiving,...
Ngày tải lên: 05/11/2012, 14:45
socket programming in c.
... clntSocket); /* Error handling function */ /* TCP client handling function */ int main(int argc, char *argv[]) { int servSock; int clntSock; struct sockaddr _in echoServAddr; struct sockaddr _in echoClntAddr; ... gets a socket for an incoming client connection by calling accept () int accept(int socket, struct sockaddr *clientAddress, unsigned int *addressLength) accept() dequeues the next connection on ... new socket for each client connection Communicate with the client via that new socket using send() and recv() Close the client connection using close() Creating the socket, sending, receiving,...
Ngày tải lên: 15/11/2012, 14:57
Question Bank Introduction to .NET and Programming in C#
... [1.0] “MyClass” a) Class myclass b) class Myclass 38 c) class MyClass d) Class MyClass Which of the following is a valid variable in C# ? a) c) _Class b) 39 Class Class d) @class Basic input and ... Which of the following are correct statements for implementing an abstract class a) public abstract void class ClassA [1.0] c) abstract public ClassA b) public abstract class ClassA 105 Which ... Static constructors can be take parameters called explicitly or implicitly b) Static constructors can have e) Static constructors are called accessibility modifiers when the class is loaded c) ...
Ngày tải lên: 09/04/2013, 09:10
6.087: Practical Programming in C
... dict.h The contents of these files are described briefly below main .c: dict .c: #include #include #include "dict.h" int main() { } dict.h: #include "dict.h" /* data structure for ... declared with the static keyword in dict .c (c) Congratulations! You’re done and ready to compile your code Write the command line that you should use to compile this code (using gcc) Let’s call ... the dictionary data structure to be accessible only from functions in dict .c You remove the declaration from dict.h Is it still possible to directly access or modify the variable from main .c, even...
Ngày tải lên: 25/04/2013, 08:07
network programming in c
... connect"); close(fd); continue; } } 23 Accepting Connections #include #include int connfd; struct sockaddr _in cliaddr; socklen_t cliaddrlen = sizeof(cliaddr); connfd ... (cliaddr) 24 Accepting Connections • A TCP/IP server may have multiple connections outstanding • • • Can accept() connections one at a time, handling each request in series Can accept() connections ... either struct sockaddr _in or • Cast it to a struct sockaddr before calling the socket routines struct sockaddr _in6 struct sockaddr _in addr; // Fill in addr here if (bind(fd, (struct sockaddr *)...
Ngày tải lên: 05/09/2013, 09:57
Tài liệu Programming in C++ docx
... header files ❑ xlC (IBM) Compiling and Linking (UNIX) ❑ g++ (GNU, egcs) CC -c main.cc CC -o prog main.cc sum.cc -lm ❑ KCC (KAI) ❑ Compiler /Programming Environments Typical Compiler Options (UNIX) ... to C+ + Page 61 Inline Functions The aim of inline functions is to reduce the usual overhead associated with a function call The effect is to substitute inline each occurrence of the function call ... http://www.fz-juelich.de/zam/cxx/ ➠ Parallel Programming with C+ + ➠ Forschungszentrum Jülich Local C+ + Information ❑ Official C+ + On-line FAQ http://www.cerfnet.com/~mpcline /C+ +-FAQs-Lite/ Programming in C+ + Dr...
Ngày tải lên: 13/12/2013, 08:15
Tài liệu Socket Programming in C# Part 1 – Introduction pptx
... m_socListener.Bind( ipLocal ); //start listening m_socListener.Listen (4); // create the call back for any client connections m_socListener.BeginAccept(new AsyncCallback ( OnClientConnect ),null); cmdListen.Enabled ... EndAccept The EndAccept returns a socket object which represents the incoming connection Here is the code for the callback delegate: public void OnClientConnect(IAsyncResult asyn) { try { m_socWorker ... callback BeginAccept is a non-blocking method that returns immediately and when a client has made requested a connection, the callback routine is called and you can accept the connection by calling...
Ngày tải lên: 18/01/2014, 08:20
programming in c# with visual studio 2010 vol i (microsoft)
... specify the following settings for the project, and then click OK: a In the Installed Templates list, under Visual C# , click Windows b In the center pane, click Console Application Introducing ... Module 12: Using Collections and Building Generic Types Lesson 1: Using Collections Lab A: Using Collections Lesson 2: Creating and Using Generic Types Lesson 3: Defining Generic Interfaces and Understanding ... assemblies in the GAC This can include installing and uninstalling assemblies in the GAC so that multiple applications can access them Introducing C# and the NET Framework Tool 1-15 Description...
Ngày tải lên: 24/01/2014, 19:37
programming in c# with visual studio 2010 vol II (microsoft)
... Implementing Interfaces Lesson 1: Using Inheritance to Define New Reference Types Lesson 2: Defining and Implementing Interfaces Lesson 3: Defining Abstract Classes Lab: Inheriting from Classes ... Module 12: Using Collections and Building Generic Types Lesson 1: Using Collections Lab A: Using Collections Lesson 2: Creating and Using Generic Types Lesson 3: Defining Generic Interfaces and Understanding ... default values in the constructor? Encapsulating Data and Defining Overloaded Operators 10-17 Defining Properties in an Interface Key Points An interface defines a contract that specifies the methods...
Ngày tải lên: 24/01/2014, 19:43
Tài liệu Object-Oriented Programming in C++, 3rd Edition docx
... Assigning string Objects Input/Output with string Objects Finding string Objects Modifying string Objects Comparing string Objects Accessing Characters in string Objects Other string Functions ... Constructing the CRC Cards Classes Responsibilities Collaborators The Tenant CRC Card The Expense CRC Card The Rent Input Screen CRC card The Rent Record CRC Card The Expense Input Screen CRC ... Exercises CHAPTER 9—INHERITANCE Derived Class and Base Class Specifying the Derived Class Accessing Base Class Members The protected Access Specifier Derived Class Constructors Overriding Member Functions...
Ngày tải lên: 21/02/2014, 06:20
A Complete Guide to Programming in C++ doc
... 158 Inserting and Erasing in Strings 160 Searching and Replacing in Strings 162 Accessing Characters in Strings 164 Exercises 166 Solutions 168 Chapter 10 Functions 171 Significance of Functions ... polymorphic classes In addition to defining virtual functions, dynamic downcasting in polymorphic class hierarchies is introduced Chapter 26 describes how defining pure virtual methods can create ... of string manipulation These include inserting and erasing, searching and replacing, comparing, and concatenating strings Chapter 10 describes how to write functions of your own The basic rules...
Ngày tải lên: 05/03/2014, 17:20
Object Oriented Programming in C++ ppt
... Key Ctrl Ctr A Ctrl B Ctrl C Ctrl B Ctrl E Ctrl F Ctrl G Backspace Tab Ctrl J Ctrl K Ctrl L Enter Ctrl N Ctrl O Ctrl P Ctrl Q Ctrl R Ctrl S Ctrl T Ctrl U Ctrl V Ctrl W Ctrl X Ctrl Y Ctrl Z Escape ... background Table E.2 Color Constants for set_color() cBLACK cDARK_BLUE cDARK_GREEN cDARK_CYAN cDARK_RED cDARK_MAGENTA cBROWN cLIGHT_GRAY cDARK_GRAY cBLUE cGREEN cCYAN cRED cMAGENTA cYELLOW cWHITE ... keywords, which usually begin with one or two underscores, as in _cdecl or int16 A asm auto B bool break C case catch char class const const_cast continue D default delete double dynamic_cast E else...
Ngày tải lên: 05/03/2014, 20:20
Pro NET 4 Paralle Programming in C# potx
... Listing 2-7 demonstrates creating a cancellable task and polling to check for cancellation 17 CHAPTER ■ TASK PROGRAMMING Listing 2-7 Cancelling a Task using System; using System.Threading; using ... Console.ReadLine(); // cancel the task Console.WriteLine("Cancelling task"); tokenSource.Cancel(); 18 CHAPTER ■ TASK PROGRAMMING // wait for input before exiting Console.WriteLine("Main method complete ... a line from the console Console.ReadLine(); // cancel the task Console.WriteLine("Cancelling task"); tokenSource.Cancel(); // wait for input before exiting Console.WriteLine("Main method complete...
Ngày tải lên: 05/03/2014, 21:20
Pro .NET 4 Parallel Programming in C# doc
... Creating a Task that you can cancel is a four-step process: Create a new instance of System.Threading.CancellationTokenSource: CancellationTokenSource tokenSource = new CancellationTokenSource ... cancelling tasks, each of which I describe in the following sections Table 2-3 Canceling Tasks Problem Solution Listing Create a cancellable task Get a System.Threading.CancellationToken by creating ... tokens Create a composite cancellation source by calling the CancellationTokenSource.CreateLinkedTokenSource() method 2-11 Poll for task cancellation Check the isCancellationRequested property of CancellationToken...
Ngày tải lên: 06/03/2014, 20:21
Socket Programming in C/C++ ppt
... server client socket socket bind connect listen accept close send/recv send/recv shutdown shutdown close close c Mani Radhakrishnan and Jon Solworth Socket Programming in C/ C++ sockets TCP UDP socket ... Socket Programming in C/ C++ sockets TCP UDP Concurrent Server To build a concurrent server: a fork is performed after the accept The child process closes listenFd, and communicates using connectFd ... unreliable c Mani Radhakrishnan and Jon Solworth Socket Programming in C/ C++ sockets TCP UDP Socket characteristics (cont’d) Each socket type has one or more protocols Ex: TCP/IP (virtual circuits)...
Ngày tải lên: 15/03/2014, 17:20
Windows Phone Programming in C# doc
... particular computer hardware) into machine code instructions that the computer processor can actually execute This compilation process is called Just In Time compilation because the actual machine ... make the contact that detects the input point A capacitive touch screen works in a different way An array of conductors underneath the screen surface detects the change in capacitance caused by ... you install the framework you get a command line compiler which can take C# source files and convert them into executable ones using console commands such as: csc MyProg.cs This command will compile...
Ngày tải lên: 17/03/2014, 13:20
Network programming in c
... #include #include #include #include #include #include #include #include int main(int argc, char ... gets the string that the server sends The client source 12: /* ** client .c a stream socket client demo */ #include #include #include #include #include #include #include #include #include ... #include #include #include #include #include #include #include #include #include #include #include 11 ...
Ngày tải lên: 19/03/2014, 13:41