Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
224 views
in Technique[技术] by (71.8m points)

standard c library for escaping a string

Is there a standard C library function to escape C-strings?

For example, if I had the C string:

char example[] = "first line
second line: "inner quotes"";

And I wanted to print

"first line
second line: "inner quotes""

Is there a library function that will do that transformation for me? Rolling my own just seems a little silly.

Bonus points if I can give it a length to escape (so it stops before or beyond the ).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...