I have a function I am trying to use that wants a type int%
I have tried casting an int to int% with static_cast and safe_cast and implicit cast....no such luck....does anyone know what int% is??
I have a function I am trying to use that wants a type int%
I have tried casting an int to int% with static_cast and safe_cast and implicit cast....no such luck....does anyone know what int% is??
Perhaps you misread and it should be int*, i.e., a pointer to int.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Nope.....it's int%
It does not look like any digraph can be part of a type name, or would be easily confused as part of a type name in an error message.Originally Posted by phantomotap
koooee, post the smallest and simplest program that demonstrates the error.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I am using the USB 1208LS from Measurement Computing along with their dll MccDaq.dll for the function calls, It is probably some type they decided to make up and not give much documentation on....I have had no luck finding anything.
The function is DOutScan(int% freq)
trying to call MccDaq:OutScan(38000) gives an compile error saying it can't convert int to int%
thanks for the interest
so the giant smily face wasn't suppose to happen
MccDaq: : DOutScan(int% freq)
Oh, on a hunch I checked, and now I understand. This is not standard C++. This is C++/CLI, and the % is analogous to a reference. Consequently, the reason why you cannot call MccDaq::OutScan(38000) is obvious: the int literal 38000 is not a modifiable lvalue.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
It has nothing whatsoever to do with names and even less to do with error messages. But you've figured it out so I don't guess it matters.It does not look like any digraph can be part of a type name, or would be easily confused as part of a type name in an error message.
Soma
Explain. By "digraph" I assumed that you meant the alternative tokens that consist of two characters each. If you mean "digraph" more generally, then I posit that your post was not helpful at all.Originally Posted by phantomotap
After all, if your usage has "nothing whatsoever to do with names and even less to do with error messages", then it was out of point since we are talking about a type name mentioned in an error message.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
"Explain."
The digraph and trigraph tokens are greedily parsed and may or may not be replaced by the tokens they represent in any output the compiler produces. Further, a compiler is free to produce any context it wishes in displaying such output.
In other words, saying "does not look like any digraph can be part of a type name" is idiotic. Consider `int a<:5:>' where `a' is clearly an array of 5 integers and not just an integer.
"then it was out of point since we are talking about a type name mentioned in an error message."
Really? It didn't seem that way. In fact, you were the first person to mention a type error and an error message. (Actually, you were the first person to mention any sort of error.) The OP only said he had a "int%" function he wished to use and couldn't find the proper way to use it. He could have got the information from documentation, a header, IRC, or any other resource.
Strangely enough, you had already responded with this "type name" comment before you realized/discovered that the language wasn't C++ where '%' may have actually been a type related error message instead of an unrelated error in C++--which it clearly could have been. I wonder how you managed that jump. My guess would be that you still believe the OP to be misreading his source making your snarky comments delightful.
I figured he had come across one of the worst uses of the preprocessor and had interpreted a definition--as opposed to a declaration--as part of the interface. In that light, we wouldn't have been talking about a "type name" at all.
Soma
Not really: I was merely being inaccurate, since I did not consider your example. Can braces, # and ## be part of a type name? I have the impression that they cannot, but their alternatives would be the ones under consideration here.Originally Posted by phantomotap
Since you already had a much better picture of what might be the problem, why didn't you just explain instead of posting a one word answer, and then making a snide remark concerning my response? I guess that that is my main beef with you here: instead of providing knowledge, you just made a remark that made it seem like you knew better all along and was just waiting for me to come along and make a poor attempt at answering the question. That may not have been your intent, but it sure felt like it to me.Originally Posted by phantomotap
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
"Not really: I was merely being inaccurate, since I did not consider your example."
Yea. Really. If you really wanted to say something different, that's fine, but the statement itself is still idiotic... and wrong.
"Since you already [...] remark concerning my response?"
I didn't have a "much better picture". If I would have had a better understanding of the issue I wouldn't have been thinking C++ at all. That was a guess. (I've seen the situation I thought of before.)
As for my response, "snide" is what I do best, but I only treated your statement in kind.
"I guess that that is [...] answering the question."
You are reaching. You know full well the only times I ever provoke such a situation my guile is aimed at the questioner as I intend to embarrass them into answering the question for themselves.
"That may not have been your intent, but it sure felt like it to me."
LMAO
You sincerely thought that I was sitting here patiently waiting for you to come along and embarrass yourself? 'cause everyone knows that providing a poor answer is embarrassing right?! Me? Personally? I've never felt so low as when I give a poor answer. It is my private hell.
Seriously? Even if that's really what you thought, why would you care? I'm some redneck who can't remember a large portion of my life because I too readily remember the lives I fantasize about. I've spent the bulk of my life in a book; why would I concern you?
That said, I do not believe that's what you thought.
Soma