how can I convert a variable of type template to an integer??
eman 22 0
Junior Poster in Training
Recommended Answers
Jump to PostYou can't. templates take on a data type when they are declared. For example
vector<int> list;
is a vector of integers. Once declared it can not be changed to a vector of strings or something else.But then again, maybe I misunderstood the question. Post an example of what …
Jump to PostThat makes no sense. If T is type double how is the function supposed to convert the double to a single ascii character???
Jump to PostThat makes no sense. If T is type double how is the function supposed to convert the double to a single ascii character???
Um, presumably by taking the modulo of the integer part against parameter
size
, which would presumably be 256 in this case? ;)Not saying it …
All 12 Replies
Ancient Dragon 5,243
Achieved Level 70 Team Colleague Featured Poster
eman 22 0
Junior Poster in Training
Ancient Dragon 5,243
Achieved Level 70 Team Colleague Featured Poster
raptr_dflo 48
Posting Pro
raptr_dflo 48
Posting Pro
Ancient Dragon 5,243
Achieved Level 70 Team Colleague Featured Poster
mrnutty 761
Senior Poster
raptr_dflo 48
Posting Pro
eman 22 0
Junior Poster in Training
raptr_dflo 48
Posting Pro
m4ster_r0shi 142
Posting Whiz in Training
m4ster_r0shi 142
Posting Whiz in Training
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.