码迷,mamicode.com
首页 >  
搜索关键字:struct    ( 18973个结果
poj 2632
题意:一个房间由m*n个方块组成 每个机器人占据一个方块 这些机器人能够移动 问 这些机器人的移动动作全部完成后 会不会发生冲撞事件解题策略:简单的模拟题目#include#includeusing namespace std;struct Node{ int x,y; int dir...
分类:其他好文   时间:2014-06-07 06:03:49    阅读次数:205
Go数据结构之Stack
Stack 一个简单确很有用的数据结构:FILOpackage Stackimport ( "errors" "fmt")const ( defaultLength=100)type Stack struct{ top int size int element [...
分类:其他好文   时间:2014-06-07 05:14:42    阅读次数:211
boost::interprocess::shared_memory_object(1)(基本类型)
#include #include struct pos2d{ int x; int y;};using namespace std;int main(){ //boost::interprocess::shared_memory_object类是按照单个字节的方式读写共享内存,用...
分类:其他好文   时间:2014-06-07 03:57:20    阅读次数:277
iOS下单例模式实现(objective-c arc gcd)
单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。这里主要介绍下在arc下,利用gcd实现单例。第一步:声明一个静态实例staticSoundTool *_instance;第二步:重写初始化方法+ (id)allocWithZone:(struct _NSZone *)zo...
分类:移动开发   时间:2014-05-29 02:49:34    阅读次数:367
UITableView属性和方法
1、初始化一个UITableView1 - (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)style1 struct CGRect {2 CGPoint origin;3 CGSize size;4 };5 typedef...
分类:其他好文   时间:2014-05-29 02:42:20    阅读次数:254
LeetCode --- Add Two Numbers
题目链接说来算是个基础题目,可是还是各种CE,各种WA,基础还是不扎实。附上代码: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *ne...
分类:其他好文   时间:2014-05-28 23:56:38    阅读次数:382
学习笔记之gethostbyaddr函数
刚才学了gethostbyname函数,这个gethostbyaddr函数的作用是通过一个IPv4的地址来获取主机信息,并放在hostent结构体中。#include struct hostent * gethostbyaddr(const char * addr, socklen_t len,.....
分类:其他好文   时间:2014-05-28 01:46:42    阅读次数:331
linux tcp server demo
#include #include #include #include #include #include #define MAXLINE 80 #define SERV_PORT 6970 void do_echo(int sockfd, struct sockaddr *pcl...
分类:系统相关   时间:2014-05-27 18:06:51    阅读次数:435
(原创)舌尖上的c++--相逢
引子 前些时候,我在群里出了一道题目:将变参的类型连接在一起作为字符串并返回出来,要求只用函数实现,不能借助于结构体实现。用结构体来实现比较简单:template struct Connect;templatestruct Connect{ static string GetName() ...
分类:编程语言   时间:2014-05-27 16:25:51    阅读次数:492
C++ pair(对组)用法
类模板:template struct pair参数:T1是第一个值的数据类型,T2是第二个值的数据类型。功能:pair将一对值组合成一个值,这一对值可以具有不同的数据类型(T1和T2),两个值可以分别用pair的两个公有函数first和second访问。具体用法:1.定义(构造):1 p...
分类:编程语言   时间:2014-05-26 17:54:31    阅读次数:327
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!