|
-
May 26th, 2015, 09:08 AM
#13
Re: Vector of Templates Problem
 Originally Posted by 2kaud
main() cannot be used with a template - hence the errors!
but you still haven't explained why and what you are trying to achieve. 
I think it's okay to use templates with main() function. I don't know if there is any limitations on where I can use it.
Anyways I'm trying to read a mathematical expression into a vector. First I take the expression into a string for example
(5+5)*9
As you can see there are two data types in this expression the first is double or int for numbers and second is char for operators like +, -, %, (,/ etc. Copying the string into vector is not a problem nor converting the string numbers into double. The problem is vector can only hold data of same type hence I was trying to use templates with vector so that I can use it to store both numbers and characters. That's all I wanna do to store elements of different data types into single vector
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|