This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
> | |
<TableLayout | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:stretchColumns="*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
> | |
<TableLayout | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:stretchColumns="*" | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<stdio.h> | |
using namespace std; | |
int main() | |
{ | |
int a[10], b[10], c[20]; | |
for (int i = 0; i < 10; i++) | |
a[i] = b[i] = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IPAddress ip = new IPAddress(new byte[] { 127, 0, 0, 1 }); | |
IPAddress ip = IPAddress.Parse("127.0.0.1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IPAddress ip = IPAddress.Parse("127.0.0.1"); | |
IPEndPoint iEp = new IPEndPoint(ip, 12345); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Socket socket = new Socket(AddressFamily.InterNetwork,SocketType.Stream, ProtocolType.Tcp); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Point | |
{ | |
private int x, y; // private fields | |
public Point (int x, int y) // constructor | |
{ | |
this.x = x; | |
this.y = y; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Point p1 = new Point(); // Point is a *struct* | |
Form f1 = new Form(); // Form is a *class* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form f1; // Allocate the reference | |
f1 = new Form(); // Allocate the object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Point myPoint = new Point (0, 0); // a new value-type variable | |
Form myForm = new Form(); // a new reference-type variable | |
Test (myPoint, myForm); // Test is a method defined below | |
void Test (Point p, Form f) | |
{ | |
p.X = 100; // No effect on MyPoint since p is a copy | |
f.Text = "Hello, World!"; // This will change myForm’s caption since | |
// myForm and f point to the same object | |
f = null; // No effect on myForm |
OlderNewer