摘要: 将以空格为分隔符分隔的字符串逆序打印,但单词不逆序。例如“Hello world Welcome to China”的打印结果为“China to Welcome world Hello”。#include #include /* Print string str partially, from start to end-1. */void print_word(const char * str, int start, int end){int i; for (i = start; i = 0; --i){if (' ' == str[i]){/* Print the word 阅读全文
posted @ 2013-10-25 13:53 夜雨阑珊 阅读(684) 评论(0) 推荐(0) 编辑
摘要: #include union u{ int i; char c; }ui; int main(void) { ui.i=512; ui.c='a'; printf("%i",ui.i); printf("%c",ui.c); // your code goes here return 0;}结构体变量,覆盖,从低地址开始存00000000 00000000 00000010 00000000=51200000000 00000000 0000000097=97覆盖后00000000 00000000 00000010 97取i... 阅读全文
posted @ 2013-10-25 11:56 夜雨阑珊 阅读(160) 评论(0) 推荐(0) 编辑