文章分类 -  c 学习

java/c/apk把Bitmap保存成png图片
该文被密码保护。
posted @ 2014-10-16 10:52 snowdrop 阅读(3) 评论(0) 推荐(0)
在c/java code中打印log--(把多个字符串起来打印一行)
摘要:#include #include #include #ifdef NOT_EMULATOR#define TAG "for_test"#include #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__... 阅读全文
posted @ 2014-09-16 17:17 snowdrop 阅读(987) 评论(0) 推荐(0)
获取是否是eng load or 非eng loa办法
摘要:1.在Android.mk中定义一个ENGload时的flagAndroid.mk....ifeq ($(TARGET_BUILD_VARIANT),eng)//user,userdebug. LOCAL_CFLAGS += -D__ENG_LOADendif在code中:#if defined... 阅读全文
posted @ 2014-08-20 10:48 snowdrop 阅读(296) 评论(0) 推荐(0)
静态局部变量,每次call时的值
摘要:#includeint fun( int n) { static int f = 1; f = f * n; return f;}void main() { int i; for (i = 1; i <= 5; i++) printf("fun(%d)=%... 阅读全文
posted @ 2014-08-04 21:09 snowdrop 阅读(169) 评论(0) 推荐(0)
c中用宏定义定义一个方法
摘要:用宏定义定义一个方法,不用再对SFunc进行定义了,可以(在main中)直接call#ifdef sDebug #define SFunc(a) func(a)#else #define SFunc(a)#endif//#ifndef myFunvoid func(int a){ ... 阅读全文
posted @ 2014-07-25 16:15 snowdrop 阅读(397) 评论(0) 推荐(0)
用c读取一个文件,并把内容存到一个二维数组中
摘要:1.txt内容是int类型#include int main() { int a[3][3]; int i, j; FILE* fp = fopen("d:\\a.txt", "r"); if (fp == NULL) { printf("无文件"); ... 阅读全文
posted @ 2014-06-12 17:31 snowdrop 阅读(1687) 评论(0) 推荐(0)