函数功能:该函数将一个字符串转为字形下标的数组。此函数可用来确定一种字体里是否存在某个字形
控制台下代码:
#include "stdafx.h"
#include
#include"stdio.h"
void main()
{
char ch[] = {'0'};
WORD chnl[20] = {0};
HDC hdc;
hdc = GetWindowDC(0)...
分类:
其他好文 时间:
2014-05-12 15:14:13
阅读次数:
267
类型转换函数能够实现把一个类 类型 转换成
基本数据类型(int、float、double、char等) 或者 另一个类
类型。其定义形式如下,注意不能有返回值,不能有参数,只能返回要转换的数据类型。class X{public: operator TYPE() { //...
分类:
编程语言 时间:
2014-05-12 12:23:59
阅读次数:
329
已知在Java中,boolean、byte、short、int、long、char、float、double这八种是基本数据类型,其余的都是引用类型,比如String、数组、接口、对象等。
当我们声明一个引用类型变量时,系统只为该变量分配了引用空间,并未创建一个具体的对象; 当用new为对象...
分类:
其他好文 时间:
2014-05-12 11:58:21
阅读次数:
342
题目:输入数字n,按顺序打印出从1到最大的n位十进制数,比如输入3,则打印出1,2,3一直到最大的3位数即999.分析:本题最关键的部分是当n值非常大的时候会超出数据类型的范围。偷个懒,没有实现打印1,2,3....999.可以利用分割把string分割成char[]。然后单个的char转为int再...
分类:
其他好文 时间:
2014-05-12 10:54:40
阅读次数:
255
C++中打开文件的方法。
1.system();
函数原型: int system(char *command);
作用:发出一个DOS命令。
特点:该函数是同步的,不灵活。
2.WinExec()
3.ShellExecute()
4.CreateProcess()
{CSDN:CODE:337983}...
分类:
其他好文 时间:
2014-05-11 14:28:00
阅读次数:
334
java中使用jni c中提供的char*数据...
分类:
移动开发 时间:
2014-05-11 06:54:22
阅读次数:
392
getchar的返回值
这样的代码有什么问题:
char c;
while((c = getchar()) != EOF)....
getchar返回值变量必须是int型。因为EOF通常定义为-1,二十进制为255的字符会被符号扩展,和EOF比较时会相等,从而
过早第结束输入。
feof函数的使用
为什么这些代码最后一行复制了两遍?
#include
#inclu...
分类:
编程语言 时间:
2014-05-11 06:22:53
阅读次数:
422
八数码0.0,我又来水博客了。
IDA*算法,A*为曼哈顿距离,判重用康拓展开。
#include
#include
#include
#include
#include
using namespace std;
int a[4][4];
int dx[]={0,0,-1,1};
int dy[]={-1,1,0,0};
char s[]="123804765";
int end[4]...
分类:
其他好文 时间:
2014-05-11 06:20:57
阅读次数:
334
1. const char* 和string 转换(1) const char*转换为
string,直接赋值即可。 EX: const char* tmp = "tsinghua". string s = tmp;(2)
string转换为const char*,利用c_str() ...
分类:
其他好文 时间:
2014-05-11 00:51:23
阅读次数:
284
1.在c语言中:int main( void )int main( int argc,
char *argv[] )如果不需要从命令行中获取参数,请用int main(void) ;否则请用int main( int argc, char
*argv[] ) 。如果 main 函数的最后没有写 re...
分类:
其他好文 时间:
2014-05-10 20:43:13
阅读次数:
445