我们在前一章介绍了block的用法,而正确使用block必须要求正确理解block的内存管理问题。这一章,我们只陈述结果而不追寻原因,我们将在下一章深入其原因。一、block放在哪里我们针对不同情况来讨论block的存放位置:1.栈和堆以下情况中的block位于堆中:void foo(){ _...
分类:
其他好文 时间:
2014-09-30 18:39:09
阅读次数:
174
using System;using System.Collections.Generic; class Program{ static void Main(string[] args) { string[] floors ={ "第3楼", "第2楼", "第11楼" }...
分类:
其他好文 时间:
2014-09-30 18:01:39
阅读次数:
174
// 线程任务基类和线程池基类文件
#ifndef _ITHREADPOOL_H
#define _ITHREADPOOL_H
class IHandle
{
public:
IHandle(){}
virtual ~IHandle(){}
public:
virtual void Run() = 0;
};
class IThreadPool
{
public:
...
分类:
编程语言 时间:
2014-09-30 18:01:19
阅读次数:
299
#include#include#includeint c[501],a[501],b[501],n,nn,nl,i,j,flag,temp[501],temp1[501];char s[501],s2[501];void input (){ scanf("%s ",&s); sc...
分类:
其他好文 时间:
2014-09-30 17:24:59
阅读次数:
144
服务器端程序:
import java.io.*;
import java.net.*;
import java.util.*;
public class ChatServer {
boolean started = false;
ServerSocket ss = null;
List clients = new ArrayList();
public static void ma...
分类:
编程语言 时间:
2014-09-30 17:06:39
阅读次数:
274
JavaScript中void(0)的含义概述void运算符执行传递给它的语句,然后返回undefined。语法voidexpressionvoid运算符通常仅仅被用来获取undefined的原始值,通常用void(0)(等同于void0)。我们为什么不直接用undefined呢?undefined...
分类:
编程语言 时间:
2014-09-30 16:30:19
阅读次数:
225
直接上代码,代码比较简单 1 class Program 2 { 3 private delegate string GetAString(); 4 static void Main(string[] args) 5 { 6 ...
分类:
其他好文 时间:
2014-09-30 16:25:39
阅读次数:
218
代码:-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ //切换方法1 //动画效果:左右滑动 //必须有导航器视图才能切换 [self.navigationController pushView...
分类:
其他好文 时间:
2014-09-30 14:54:19
阅读次数:
165
Thread.Sleep in WinRTstatic void Sleep(int ms){new System.Threading.ManualResetEvent(false).WaitOne(ms);}
import相关的
public class MainActivity extends Activity {
定义好所有需要的控件
private TextView tv
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceStat...
分类:
移动开发 时间:
2014-09-30 12:49:49
阅读次数:
180