易截截图软件、单文件、免安装、纯绿色、仅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


相关文档:

ODBC C编程访问数据库

 新建一个Win32 Application,并在相应文件夹下新建一个book.mdb, 里面有一个表BookInfo,表中有以下几例:
id:
BookName:
Author:
等;
//------------------------------------------------------------------------------
// Copyright (c) 2009 eryar All rights reserved.
//
// File : Main.cpp
// ......

(转)C/C++ 宏详解

 (转)C/C++ 宏详解 收藏
众多C++书籍都忠告我们C语言宏是万恶之首,但事情总不如我们想象的那么坏,就如同goto一样。宏有
一个很大的作用,就是自动为我们产生代码。如果说模板可以为我们产生各种型别的代码(型别替换),
那么宏其实可以为我们在符号上产生新的代码(即符号替换、增加)。
关于宏的一些语法问题,可 ......

Eclipse对C/C++的支持比Netbeans好多了

Netbeans经常会出现写代码的时候代码提示出不来的情况,甚至是代码根本没错,编译都能通过,但是代码帮助就提示我说我有错误,在下面画条红线!而这些问题Eclipse没有出现过!而且Eclipse有专门的CDT插件开发小组,很好强大。 ......

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

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

C标准库头文件 assert.h

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