Today I do my csis0234 homework and find the following error:
error: ctime: No such file or directory
error: cstdlib: No such file or directory
…
anything wrong?
Answer:
Those are the C++ versions. Don’t use those in a C program. The C versions are
Code:
#include
#include
You can create a char array as follow:
char myStr[] = “text”;
char* myStr = “text”;
UDP Socket Programming – Using C language
* UDP server : simple UDP server that prints received messages.
source : udpServer.c
usage : ./udpServer
* UDP client : simple UDP client that sends data to server.
source : udpClient.c
usage : ./udpClient server data1 … dataN
To compile :
* linux : gcc -Wall -o foo foo.c
* solaris : gcc -Wall -o foo foo.c -lsocket -lnsl
(more…)
You can’t “Listen” on UDP sockets, only TCP, since UDP is a connectionless protocol – it’s a message-passing protocol. If you drop the “Listen” parameter to the new(), you’ll find that you’ll be able to create the socket. You’ll then want to call $sock->recv() (with the appropriate arguments), which will block until you receive a message…
If you got the “missing assets” error in your XNA project
Looks like you’re forgetting to mve your textures. In XNA you must keep your textures relative to your models.
For example, if my model was C:\Models\Foo.fbx and my texture was C:\Models\Textures\Bar.bmp, I must move not only Foo.fbx but Textures\Bar.bmp to my Content folder.
from : http://blog.163.com/cc_bei_jing/blog/static/77154120200941195933481/
标准库Vector类型
使用需要的头文件:
#include
Vector:Vector 是一个类模板。不是一种数据类型。 Vector是一种数据类型。
(more...)