易截截图软件、单文件、免安装、纯绿色、仅160KB

一段用来判断日期是星期几的C代码

/////////////////////////////////////////////////
// 主题:一段用来判断日期是星期几的代码
// 描述:摘自《CCFAQ》
// 作者:天之枫
// 时间:2010-02-13
///////////////////////////////////////////////// 
#include <stdio.h>
int dayofweek(int y, int m, int d) // 判断输入的日期是星期几
{
static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
y -= m < 3;
return (y + y/4 - y/100 + y/400 + t[m-1] + d) % 7;
} /* 0 = Sunday */
int main(void)
{
printf( "今天是星期%d \n", dayofweek(2010,2,13) );
return 0;
}
 


相关文档:

在vc.net中的C/C++代码生成DLL步骤


1 选择new->project->win32 console project;
    在这一步的选框上有一个选项是 create dictionary for solution, 我不知道这个具体是什么作用,选了之后会项目出现两层文件夹,比如你创建一个命名为test的项目,会生成test文件夹,test中包含另一个test文件夹,你的项目实际上放在了内层te ......

about pack and align for C/C++

http://msdn.microsoft.com/en-us/library/2e70t5y1(VS.80).aspx
#pragma
pack(  n  )
n : Valid values are 1, 2, 4, 8, and 16.the
alignment of a member will be on a boundary that is either a multiple of 
n
 or
a multiple of the size of the member
,
whichever is smaller.
......

浅谈c程序函数调用过程

关键词:
栈区:就是一个内存地址空间,每调用一次函数就会在栈区为此函数分配一段空间(主要用于存储局部变量,
此段空间下面就直接定义为函数栈)
ebp :用于存放函数栈的栈顶地址
esp:用于存放此函数栈的栈底地址
注意:栈顶地址大于栈底地址,栈是从栈顶向栈底增长。即ebp-->esp;
下面我们分析如下代码例子,看 ......

在2000和xp下如何将c盘fat32转换成ntfs


日志
分享给好友复制网址隐藏签名档大字体
上一篇 下一篇 返回日志列表
在2000和xp下如何将c盘fat32转换成ntfs
编辑 | 删除 | 权限设置 | 更多▼
更多▲
设置置顶
推荐日志
转为私密日志
Bandit    发表于2007年12月12日 09:12 阅读(9) 评论(0) 分类: 个人日记 权限: 公开
1、到命令提 ......

C 指针

#include
void printptr(int *i){
printf("&i of printfptr = %#X\n",&i);
printf("i of printfptr = %#X\n",i);
printf("*i of printfptr = %d\n",*i);
printf("i+1 of printfptr = %#X\n",i+1);
printf("*(i + 1) of printfptr = %d\n",*(i ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号