Why Can't we use va_list twice?
Can any explain me how it creates memory issue ?
Learningvinit
0
Newbie Poster
Recommended Answers
Jump to PostYou can use a va_list twice, provided it's properly disposed of with va_end() and re-initialized with va_start() or copied with va_copy(). What you can't do is assume that va_list represents a bidirectional read-only collection. It could easily be a generated array or list of arguments that are modified or destroyed …
Jump to PostAnswer rephrased: You can use the same
va_list
twice.If you mean why can't you use the same
va_list
twice without resetting it withva_end
andva_start
: How would that work? You have to rewind it somehow - otherwise how could it possibly know that you want to start from …
All 5 Replies
sepp2k
378
Practically a Master Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
nitin1
commented:
nice one!!
+2
Learningvinit
0
Newbie Poster
sepp2k
378
Practically a Master Poster
nitin1
commented:
hehe :p
+2
nitin1
15
Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.