String content is inverse

xiaoxiao2021-03-06  79

One question about the topic of the string, for the first time, the topic is not very difficult, but the practice of self-study has a new understanding of the pointer, the arrays and pointers are essentially the same, otherwise how can it be Interchange] Nipped a function FUN (Char * S), the function of the function is to reverse the contents in the string. Examples: The original content in the string is: abcdefg, then call the function, the content in the string is: gfedcba # include #include #include #define n 81

Char * fun (char * s)

{INT LEN = Strlen (S); INT I, T; For (i = 0; i

Main () {char * a; char * ch; clrs (); Printf ("Enter A String:"); Gets (a); Printf ("THE Original String IS:"); PUTS (a); ch = fun (a); Printf ("/ n"); Printf ("The String After Modified:"); PUTS (CH);

转载请注明原文地址:https://www.9cbs.com/read-76834.html

New Post(0)