Tips on C, C++, VC++, Java, C#, .Net, VB, ASP Programmming
| What's the difference between these two
declarations? struct str1 { ... } ; Ans : The first form declares a structure tag whereas the second declares a typedef. The main difference is that the second declaration is of a slightly more abstract type -- its users don't necessarily know that it is a structure, and the keyword struct is not used when declaring instances of it. Why is it necessary to use a reference in the
argument to the copy constructor? class sample int i ; public : sample ( sample p ) i = p.i ; } } ; sample s ; } While executing the statement sample s1 ( s ), the copy constructor would get called. As the copy construct here accepts a value, the value of s would be passed which would get collected in p. We can think of this statement as sample p = s. Here p is getting created and initialized. Means again the copy constructor would get called. This would result into recursive calls.Hence we must use a reference as an argument in a copy constructor. Accessing Objects from Multiple
Threads... File and FileInfo
classes... Web Controls... What are DTDs? |