学习《Linux编程第四版》时遇到问题:报错:错误:‘sem_union’的存储大小未知原因:Linux2.6版内核unionsem_union联合体已被注释解决方法:重新定义sem_unionunionsemun{intval;structsemid_ds*buf;unsignedshort*array;structseminfo*__buf;};
分类:
系统相关 时间:
2014-12-07 06:44:34
阅读次数:
223
"500行或更少" "What I cannot create, I do not understand." -- Richard Feynman 《500行或更少》--开源应用架构系列第四版的源码。 项目的目的在于给阅读者更广的视野,让阅读者理解软件设计者的想法。 项目地...
分类:
其他好文 时间:
2014-12-05 19:51:22
阅读次数:
234
1、P128
一个获取日期 时间 格式化获取时间 日期 的程序。
#include
#include
int main(int argc,char** argv)
{
struct tm* time1,*time_trans; //时间数据结构
time_t alt;
char c_time[128];
char* result;
char* result1="";
time(...
分类:
系统相关 时间:
2014-12-02 09:03:05
阅读次数:
242
练习1
/**
* 第10章
* 练习1
* @author zhtt
*
*/
public class Test {
public static void main(String[] args) {
Outer outer=new Outer();
Outer.Inner inner=outer.getInner();
System.out.println...
分类:
编程语言 时间:
2014-12-01 10:11:24
阅读次数:
164
1、P103
一个目录扫描程序。
#include
#include
#include
int isAdir(char* path); //判断路径是否是目录类型
void printdirs(char* path,int depth) //递归遍历打印文件与目录名
{
DIR* dir=opendir(path);
struct dirent* dirents;
ch...
分类:
系统相关 时间:
2014-11-24 22:37:00
阅读次数:
287
练习14:
package inter;
public class Test {
public static void main(String[] args) {
D d=new D();
d.a(d);
d.b(d);
d.c(d);
d.abc(d);
}
}
interface A{
void a1();
void a2();
};
interfac...
分类:
编程语言 时间:
2014-11-22 12:05:11
阅读次数:
253
泛型是在Java 1.5中被加入了,这里不讨论泛型的细节问题,这个在Thinking in Java第四版中讲的非常清楚,这里要讲的是super和extends关键字,以及在使用这两个关键字的时候为什么会不同的限制。 首先,我们定义两个类,A和B,并且假设B继承自A。下面的代码中,定义了几个静态泛型...
分类:
编程语言 时间:
2014-11-18 23:58:58
阅读次数:
374
练习3:
public class MainTest {
public static void main(String args[]){
Bcycle b=new Bcycle();
b.print();
}
/**
* 输出:
* --Bcycle-------47
* ----print---...
分类:
编程语言 时间:
2014-11-18 11:51:56
阅读次数:
269
这篇文章是《Linux程序设计 第四版》中的第二章的最后练习题(2.8综合应用),
题目是编写一个CD数据库应用程序,
首先:用两个文件来保存存储的数据,一个是title_file.cdb,一个是column_file.cdb!
title_file.cdb里面保存的是唱片的基本信息:拥有如下四个字段:
CD的目录编号,标题,唱片类型,作曲家或艺术家;
column_fi...
分类:
系统相关 时间:
2014-11-16 17:24:29
阅读次数:
304
1. C++ Primer 《C++入门》(通常不用中文名)by Stanley B. Lippman有第三版和第四版,如其名,是C++入门的不二选择,是全面广泛的参考书目,内容丰富,笔触严谨。如果说Bjarne Stroustrup是C++之父的话,那么Lippman可以说是C++之母了:)晨星:...
分类:
编程语言 时间:
2014-11-12 13:19:56
阅读次数:
291