This question already has answers here:
ID field intermittently lost in custom point class
(2 answers)
Closed 4 years ago.
I'd like to use 2D points with attributes for the polygons.
The attributes should be assigned to any new points according to some kind of strategy.
Do you know if it is possible and how to do it?
Is there any doc describing how to do it?
Last time I looked at things it proved impossible. That's because the library does construct new points using the available (accessor) traits.
Similar/related questions:
ID field intermittently lost in custom point class
In fact, let me dupe-vote that!
Related
This question already has answers here:
Why use pointers? [closed]
(17 answers)
Closed 9 years ago.
I don't understand the difference between using a pointer and using a normal variable. I'm learning linked lists in class so the use of pointers seems more straightforward since pointers are used to go to the next node in the list, but I don't understand its more basic uses and I'm feeling stressed as it is something I should already understand but don't.
The pointer is in itself just a "normal" variable that just so happens to store a level of indirection to another variable.
This question already has answers here:
C++ equivalent of java's instanceof
(5 answers)
Closed 9 years ago.
How can I check the class type in c++?
In Java I used instanceof.
I prefer not to use dynamic cast, but only classic c++.
Is there any way?
Clarification:
It isn't a duplicate of another question in StackOverflow, since I asked how can I find it without using of dynamic_cast. In the other question, the answer was to use it. Please don't mark it as a duplicated.
There is no way to check class type without RTTI or it's home brew substitution. If application compiled without RTTI information about type is not stored anywhere.
This question already has answers here:
C++ standard output format
(2 answers)
Closed 10 years ago.
I'm still new to C++ so bear with me.
I'm currently making console output applications and I want to make a simple matrix calculator. So I want the user to input 4 values for each element of the matrix. Each element should be at a different xy position on the screen. So it makes up a square, a simple 2x2 matrix.
I don't have a clue how to change the position of text in C++ though. I used the Pascal programming languages before and all you had to do was 'gotoXY(20,40)' followed by a statement.
I know this is probably an easy question, I can't seem to work it out though.
If this is on Windows, you should use SetConsoleCursorPosition. I think I have the right helper class for you here: Helper Class for Console Functions.
This question already has answers here:
parse a xml in c++
(3 answers)
Closed 8 years ago.
So I have gotten the website source, and now im trying to grab the data inside the tags. How would I go about doing that. Thanks
For example,
<start>value</start>
Set a string to value
http://expat.sourceforge.net/ and http://msdn.microsoft.com/en-us/magazine/cc163436.aspx two more alternatives apart from http://xerces.apache.org/xerces-c/ as mentioned by mtahmed. There are plenty more. Please compare them based on your requirement.
You can use an XML parser library. Here is a link to one such library: http://xerces.apache.org/xerces-c/
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
C++'s “placement new”
Can we create an instance of class type at the specified location in memory?if yes then how and where we should use such programming techniques?
Yes, we can. Use new(area) operator.
Another discussion at SO.