2011年8月18日

字符串指针和整形指针的区别

摘要: 其实呀,对于 char *p="afjfkjkladfsjije"; 这句话中的指针着实很奇怪。 当你 cout<<*p<<endl; 的时候,它输出的是那个字符串的首个字符——'a'。 当你 cout<<p<<endl; 的时候,它输出的是整个字符串的内容——""afjfkjkladfsjije""。感觉到奇怪了吧,为什么这句话是输出整个字符串的内容,而不是地址呢。那么,我告诉你:没有为什么!然而,经过高人指点了一下,发现是有原因的,什么原因呢?我也不太清楚,等明白了再 阅读全文

posted @ 2011-08-18 12:15 飞-虎 阅读(2454) 评论(6) 推荐(1) 编辑

STL之map——解决POJ 2503

摘要: DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message 阅读全文

posted @ 2011-08-18 09:17 飞-虎 阅读(221) 评论(0) 推荐(0) 编辑

导航