VC6运行处问题(指针方面)-----------新手,请多喷
程序代码:
void reverse_string( char *str ) { char *last_char; for( last_char = str; *last_char != NUL; last_char++ ) ; last_char--; while( str < last_char ) { char temp; temp = *str; *str++ = *last_char; *last_char-- = temp; } } void main() { char *cpStr = "abcdefg"; reverse_string( cpStr ); while( *cpStr != NUL ) { printf( "%c\n", *cpStr++ ); } }使用VC编译运行老是出现“某某指令引用的内存不可读”,望各位大大指教.