Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaSocket¿Í»§¶ËÓëC·þÎñ¶ËͨÐÅ

ת×Ô£ºhttp://hi.baidu.com/ssrt_hanbing/blog/item/62e3b934598eeb82a71e1238.html
ͨ¹ý¸ßµÍλת»»¡£
package com.commnt;
import java.net.*;
import java.io.*;
public class Client {
public String send(String address, int port, String str) {
   OutputStream os = null;
   DataInputStream is = null;
   String look = "";
   Socket socket = null;
   try {
    socket = new Socket(address, port);
    os = socket.getOutputStream();
    byte[] phone = new byte[str.length()];
    phone = ByteUtil.StringtoBytes(phone, str);
    os.write(phone);
    os.flush();
    is = new DataInputStream(socket.getInputStream());
    byte[] phone1 = new byte[str.length()];
    is.read(phone1);
    String strBype = new String(phone1);
    look = strBype.toString();
   } catch (UnknownHostException e) {
    e.printStackTrace();
   } catch (IOException e) {
    e.printStackTrace();
   } finally {
    close(socket, is, os);
   }
   return look;
}
public void close(Socket socket, DataInputStream is, OutputStream os) {
   if (os != null)
    try {
     os.close();
    } catch (IOException e) {
     e.printStackTrace();
    }
   if (is != null)
    try {
     is.close();
    } catch (IOException e) {
     e.printStackTrace();
    }
   if (socket != null)
    try {
     socket.close();
    } catch (IOException e) {
     e.printStackTrace();
    }
}
}
public class ByteUtil


Ïà¹ØÎĵµ£º

Çó·½³Ìax^2+bx+c=0µÄ¸ù(º¯Êý)

#include<stdio.h>
#include<math.h>
float x1,x2,disc,p,q;
int main()
{
void greater_than_zero(float,float);
void equal_to_zero(float,float);
void smaller_than_zero(float,float);
float a,b,c;
printf("\ninput a,b,c:");
scanf("%f,%f,%f",&a,&b,&c) ......

C bomb¡£¡£¡£¡£FML~~~

Êä³öì³²¨ÄÇÆõÊýÁÐǰN¸öºÏÊý£¬ËĸöÒ»ÐУ¬NÓÉʹÓÃÕßÊäÈ룬½éÓÚ10µ½30Ö®¼ä¡£
#include<stdio.h>
#include<math.h>
int fab(int);
int judge(int);
int main()
{
int a[30]={0};
int i,n,t=0;
do
{
printf("Input the number\n");
scanf("%d",&n);
}
while(n>3 ......

C/C++ ºËÐļ¼Êõ ×ܽá1

µÚ¶þÕ Êý¾ÝÀàÐÍ
 
Ò»¡¢Êý¾ÝÀàÐÍ·ÖÀà
 
1 ÁªºÏÀàÐÍ
2 º¯ÊýÀàÐÍ
3 ÊýÁ¿ÀàÐÍ
3.1ËãÊõÀàÐÍ
     ¢Ù »ù±¾Êý¾ÝÀàÐÍ
            ÕûÐÍ£¨°üÀ¨char£©
            ¸¡µãÐÍ ......

C/C++Öж¯Ì¬Á´½Ó¿âµÄ´´½¨ºÍµ÷ÓÃ

ת×Ô£ºhttp://dev.yesky.com/12/3067012.shtml
¶¯Ì¬Á¬½Ó¿âµÄ´´½¨²½Ö裺
¡¡¡¡Ò»¡¢´´½¨Non-MFC DLL¶¯Ì¬Á´½Ó¿â
¡¡¡¡1¡¢´ò¿ªFile —> New —> ProjectÑ¡ÏѡÔñWin32 Dynamic-Link Library —>sample project
¡¡¡¡—>¹¤³ÌÃû£ºDllDemo
¡¡¡¡2¡¢Ð½¨Ò»¸ö.hÎļþDllDemo.h
ÒÔÏÂÊÇÒýÓÃÆ¬¶Î£º ......

C/C++µ¥Ôª²âÊÔÀíÂÛ¾«Òª£¨Î壩

µÚ¶þÕ Õ÷·þ¿É²âÐÔÄÑÌâ
 
2.1 ¿É²âÐÔÎÊÌâÏê½â£¨1£©
 
    µ¥Ôª²âÊÔÐ§ÒæÌØ±ð¸ß£¬·½·¨Ò²ºÜ¼òµ¥£¬µ«È´³¢ÊÔµÄÆóÒµºÜ¶à£¬³É¹¦ÊµÊ©µÄÆóÒµºÜÉÙ£¬ÎªÊ²Ã´ÄØ£¿Ö÷ÒªÔ­Òò¾ÍÊÇÄÑÓÚÍ»ÆÆ¿É²âÐÔÎÊÌâ¡£“¿É²â”Õâ¸ö´Ê£¬Òâ˼ÒѾ­ºÜÃ÷°×ÁË£¬Èç¹û²»“¿É²â”µÄ»°£¬ÄǾÍÊDz»Äܲ⣬û·¨²â£¬¾ÍÊÇ× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ