
功能函数实现
chengmaoning
这个作者很懒,什么都没留下…
展开
-
字符串转为整数atoi
C++中有字符串转为整数的函数atoi,比较简单就不解释了,多看源码多多思考,源码如下:#include "stdafx.h"#include #include int my_atoi(const char *p){ assert(p != NULL); bool neg_flag = false; int res = 0; if (p[0] == '+' || p[0] ==原创 2013-04-08 15:34:39 · 639 阅读 · 0 评论 -
java swing jtextarea添加文本后自动显示最后一行
方法很简单,再添加文本后,添加下面一句,将光标置于文本末尾。jtextarea.setCaretPosition(jtextarea.getText().length);原创 2013-07-11 18:54:05 · 6511 阅读 · 0 评论 -
java swing按行读取文本文件,防止乱码
public String readALine(String file) throws Exception { InputStream is = this.class.getResourceAsStream(file); InputStreamReader isr = new InputStreamReader(is, "UTF-8"); BufferedReader br = new原创 2013-07-11 22:14:30 · 1153 阅读 · 0 评论