摘要: 1 package test; 2 3 public class Test { 4 5 public static void main(String[] args) { 6 7 final int num2 = Integer.parseInt(args[0]); 8 9 }10 11 }编译时,会报Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at test.Test.main(Test.java:7)最终的结论是: 运行时忘了加运行时参数了。运行时没有输... 阅读全文
posted @ 2014-01-21 16:27 xuefenhu 阅读(6411) 评论(0) 推荐(0) 编辑
摘要: #includeint main(void) { int i=0; int *pint=&i; double d=1.23; double *pDouble=&d; void *pvoid=NULL; pvoid=pint; printf("1:%d\n",*((int*)pvoid)); pvoid=pDouble; printf("2:%lf\n",*((double*)pvoid)); return 0;}因为void指针,虽然它可以接收任何类型的数据,但从它取数据回来的时候需要强制转换成相应的类型。参考链接:http://bbs. 阅读全文
posted @ 2014-01-21 15:09 xuefenhu 阅读(499) 评论(0) 推荐(0) 编辑