2012年3月14日

摘要: #include <stdio.h>#include <stdlib.h>#include <string.h> void main() { char filename[16] = "MHT"; char *type = ".txt"; char str[4]; int i = 10; itoa(i, str, 10); printf("%s %d\n", filename, sizeof(filename)); //sizeof 全部长度 printf("%s %d\n", f 阅读全文

posted @ 2012-03-14 23:44 无忧consume 阅读(181) 评论(0) 推荐(0) 编辑

摘要: #include <string.h>#include <stdio.h>int main(){ char a[30] = "string (a)"; char b[30] = "hi\0zengxiaolong"; int i;strcpy(a, b); //a[30] = "hi\0ing (a)" printf("strcpy():"); for(i = 0; i < 30; i++) printf("%c", a[i]); //hiing (a)memcpy 阅读全文

posted @ 2012-03-14 22:04 无忧consume 阅读(192) 评论(0) 推荐(0) 编辑

摘要: http://alienryderflex.com/NSLock.htmlTo understand why you need NSLock, study this little example:int x=0, y=0 ;// (globals used by all threads)// Spawn this method as a thread (via detachNewThreadSelector)// several times, to get multiple threads running.- (void) renderPixels:(id) dummyObj { int a, 阅读全文

posted @ 2012-03-14 21:49 无忧consume 阅读(267) 评论(0) 推荐(0) 编辑

摘要: NSLock Class ReferenceOverview AnNSLockobject is used to coordinate the operation of multiple threads of execution within the same application. AnNSLockobject can be used to mediate access to an application’s global data or to protect a critical section of code, allowing it to run atomically. Warn.. 阅读全文

posted @ 2012-03-14 21:48 无忧consume 阅读(636) 评论(0) 推荐(0) 编辑


Copyright © 2024 无忧consume
Powered by .NET 8.0 on Kubernetes