The use of strings is urgent.

Source: Internet
Author: User
For more information about how to use strings, see Linux general technology-Linux technology and application. # Include
# Include
# Include
# Include


Int decpt, sign;
Char * fname, * fc, * fch;

Char * filen;
Int a1 = 10, j = 0;
Int get_len (int flag ){

J ++;
Fc = fcvt (float) (a1 + j), 0, & decpt, & sign );
Printf ("fc = % s \ n", fc );
Fname = strcat (fch, fc );
Printf ("fch = % s \ n", fch );
Char fch1 [5] = ". jp2 ";
Fname = strcat (fname, fsung );
Memset (fch, 0, sizeof (fch ));
Fch = filen;

Return 0;
}



Int main (int argc, char * argv []) {
Char * dev;
Int I;

Filen = argv [3];
Fch = argv [3];
Printf ("% s \ n", fch );
For (I = 0; I <10; I ++)
Get_len (0 );

Return 0;
}
The above is my code. But it is strange that after executing this command, memset (fch, 0, sizeof (fch); clears all my * fnames, * fc, * fch, * filen;
Please give me some advice. Let's talk about the reason. This problem is not found in windows.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.