Difference between revisions of "Studio:Casting and pointers"

From STRIDE Wiki
Jump to: navigation, search
m (Text replace - 'Category:Pointers' to 'Category:Studio:Pointers')
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A cast must be applied to a pointer before anything else. In other words, you must apply scl_cast before scl_ptr, as illustrated by the following example:<br>
+
A cast must be applied to a pointer before anything else. In other words, you must apply scl_cast before scl_ptr, as illustrated by the following example:
<tt>#pragma scl_function(GetUnicodeName)<br>
+
<source lang="c">
#pragma scl_cast (GetUnicodeName, name, unsigned short*)<br>
+
#pragma scl_function(GetUnicodeName)
#pragma scl_ptr (GetUnicodeName, name,  OUT,  PRIVATE)<br>
+
#pragma scl_cast (GetUnicodeName, name, unsigned short*)
#pragma scl_string (GetUnicodeName, name, 100)</tt>
+
#pragma scl_ptr (GetUnicodeName, name,  "OUT",  PRIVATE)
 
+
#pragma scl_string (GetUnicodeName, name, 100)
 
+
</source>
[[Category:KB]]
+
[[Category:Studio:Pointers]]

Latest revision as of 18:41, 20 August 2009

A cast must be applied to a pointer before anything else. In other words, you must apply scl_cast before scl_ptr, as illustrated by the following example:

#pragma scl_function(GetUnicodeName)
#pragma scl_cast (GetUnicodeName, name, unsigned short*)
#pragma scl_ptr (GetUnicodeName, name,  "OUT",  PRIVATE)
#pragma scl_string (GetUnicodeName, name, 100)