自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 资源 (2)
  • 问答 (2)
  • 收藏
  • 关注

原创 C语言 计算数组长度

第一种情况一维数组int a[] = {1, 2, 3, 4, 5, 6};int len = sizeof(a) / sizeof(a[0]);多维数组int a[][3]={1, 2, 3, 4, 5, 6, 7};int row = sizeof(a) / sizeof(a[0]);int col = sizeof(a[0]) / sizeof(a[0][0]);二维数组是一维数组,其中每个元素是一维数组。同理,三维数组是一维数组,其中每个元素是二维数组;二维数组是一维

2021-06-21 21:29:08 1248

原创 保护宏

参考链接:C++里面保护宏的用法Clean C++:头文件保护宏C++核心准则:ES.33:如果必须使用宏定义,命名要有唯一性第一篇介绍了防止头文件重复包含的两种方法:保护宏;特定编译器命令 #pragma once 。第二篇来自书籍《Clean C++》,介绍了保护宏的三种命名方法。第三篇来自C++核心准则,指出:ES.33: If you must use macros, give them unique namesReason: Macros do not obey scope ru

2020-07-01 17:48:06 444

转载 Feature Test Macros

1.3.4 Feature Test Macros原文链接 1.3.4 Feature Test Macros。The exact set of features available when you compile a source file is controlled by which feature test macros you define.If you compile your programs using ‘gcc -ansi’, you get only the ISO C libra

2020-07-01 12:19:16 508

原创 C PUZZLE中的一道题

如下程序设计功能为打印20个负号,但没能实现。通过改变一个字符修复一个破碎的循环。已知有三种解法。 #include <stdio.h> int main() { int i; int n = 20; for( i = 0; i < n; i-- ) printf("-"); return 0; ...

2019-11-13 21:47:10 137

原创 C PUZZLES中的一道题

题目:The following C program segfaults of IA-64, but works fine on IA-32.int main() { int* p; p = (int*)malloc(sizeof(int)); *p = 10; return 0; } Why does it happen so?解答:...

2019-11-06 20:18:31 111

转载 内存对齐宏的数学解释

内存对齐宏的数学解释博主表示没看懂?-)有网友发帖问:#define _INTSIZEOF(n) ((sizeof(n)+sizeof(int)-1)&~(sizeof(int) - 1) )说能够在某些系统中内存对齐.(估计是得到一个2 或者4的整数倍)这个好象就是(x+3)&~3这样就能满足对齐了吗?请从数学上给说说.谢谢有网友发帖答:对于两个正整数 ...

2019-10-27 15:07:30 184

转载 转:Catching Integer Overflows in C

转:Catching Integer Overflows in CUpdate 20150422: clang and gcc 5 have builtins now for this, look for __builtin_add_overflow and __builtin_mul_overflow in the documentation. That makes these macros ...

2019-10-27 15:00:28 311

原创 记一个编译错误

#include<stdio.h>int main(){int a=1;switch(a){case 1:int b=20;printf(“b is %d\n”,b);break;default:printf(“b is %d\n”,b);break;}return 0;}gcc编译报错,信息如下:error: a label can only be p...

2019-09-07 21:52:17 255 2

转载 C语言宏替换问题

转载:关于C里面宏替换的问题 http://blog.chinaunix.net/uid-27714502-id-3461678.html先看一个经典的面试题:#include#define f(a,b) a##b#define g(a) #a#define h(a) g(a)int main(){printf("%s\n", h(f(1,2)));printf("%s\n",...

2019-08-17 17:29:57 1580

FSCapture.exe

这是一款非常好用的截图软件,不仅可以截取一个屏的图,还可以截取整个页面的图。

2015-03-02

windows api大全

windows api相关.应用程序接口,刚学会有些难,但是这个工具掌握后编程就会变得很简单。

2013-11-26

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除