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

C puzzles


Authentication
Login with:New JS-Kit account
Google Friend Connect
Twitter account
FriendFeed account
Yahoo account
Blogspot URL
JS-Kit account
Haloscan account
OpenID
Dear visitor,
Thanks for your interest in C programming.
In this page, you will find a
list of interesting C programming questions/puzzles,
These programs listed are the ones which I have received as
e-mail forwards from my friends, a few I read in some books, a few from the
internet, and a few from my coding experiences in C.

Most of the programs are meant to be compiled, run and
to be explained for their behaviour. The puzzles/questions can be broadly
put into the following categories:

General typo errors, which C programmers do often and are
very difficult to trace.

Small programs which are extremely hard to understand at the first
examination. These questions make a good excercise of reading and understanding
effecient code written by others.

I have used Gnu/Linux/gcc for all of them.
The order in which the programs appear doesn't have
any relation with the level of difficulty.
Please feel free to contact me if you need any help in solving the problems.
My contact info. is available here
And you might be interested in a few references for C programming
,
which I personally found very interesting.
If you are preparing for campus interviews, you might find the following
link interesting:
http://placementsindia.blogspot.com
Regards,
Gowri Kumar
C puzzles
The expected output of the following C program
is to print the elements in the array. But when
actually run, it doesn't do so.
#include
<stdio.h>
#define

TOTAL_ELEMENTS
(
sizeof
(
array
)
/

sizeof
(
array
[
0
]))
int
array
[] =
{23
,34
,12
,17
,204
,99
,16
};
int
main
()
{
int
d
;
for
(d
=-
1
;d
<=
(TOTAL_ELEMENTS
-
2
);d
++
)
printf
(&q


相关文档:

static详解(c/c++)

C/C++中Static的作用详述
一.在C语言中,static的字面意思很容易把我们导入歧途,其实它的作用有三条。
(1)先来介绍它的第一条也是最重要的一条:隐藏。
当我们同时编译多个文件时,所有未加static前缀的全局变量和函数都具有全局可见性。为理解这句话,我举例来说明。我们要同时编译两个源文件,一个是a.c,另一个是m ......

C#(C sharp)字符串和时间的相互转换

C#(C sharp)字符串和时间的相互转换。
 
一、DateTime –> string
时间类型转化成字符串类型,那是相当的简单,直接调用ToString()方法即可。如:
DateTime dt = DateTime.Now;
string dtStr = dt.ToString();
 
如果想对输出格式化,可以这么写:
dt.ToString("yyyy年MM月dd日");   ......

学习Java,C等程序开发的十大诀窍

今天解答一些同学在学开发过程中的普遍问题,就是如何学好一门语言?
我是这样来理解的,要做任何事物,首先要分析为什么要做,只有把核心的,内心的原因找到才能把一件事情做好,否则,你花再多的学费学某种技术仍然会一无所或,从我个人的成长过程来将我是从97年接触计算机,开始学的一踏糊涂,不知道老师在讲什么,不知道学了会有什 ......

C深度解剖问题代码分析笔记1

#include <stdio.h>
int main()
{
int a[5]={1,2,3,4,5};
int *ptr1=(int*)(&a+1);
int *ptr2=(int*)((int)a+1);
printf("%p,%x,%p\n",(int)a,*(ptr2+1),ptr1);//(int*)(&a));
printf("%d\n",(int*)(&a-16));
printf("%d,%x\n",ptr1[-1] ......

C标准库头文件 assert.h

 C标准库头文件 assert.h
@函数名称:   assert
函数原型:   void assert(int exp)
函数功能:   诊断类:表达式结果正确性测试并可使程序中止
函数返回:  
参数说明:   将错误信息输出到流stderr中,如果exp为0,则中止程序执行.exp-表达式
所属文件: & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号