Arvind.Sinh
BAN USER
Comments (3)
Reputation 10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
Of course not. Thread safety can be implemented in the user code based on the need. Putting it inside the Thread Map will make everyone pay performance penalty irrespective of their need.
- Arvind.Sinh June 06, 2011Comment hidden because of low score. Click to expand.
0
of 0 vote
The function needs to
1. Make sure that dest points to a valid memory address (for example, not null or 0) and
2. It has enough memory to hold all characters + null character from the source string.
3. There is no need to return anything. The function can be void if it is copying to the memory location passed via the argument.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
You can use pointer ton an integer for the reference count, in place of using an integer. When creating fresh, new an integer and initialize the reference count to 0. When you copy, you can make the pointer point to the reference count of the original object and increment it by one.
- Arvind.Sinh June 06, 2011