You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: REFERENCE.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -788,14 +788,23 @@ end
788
788
789
789
# Handling Strings
790
790
791
-
For purposes of optimization and compatibility with C, Rubex makes certain assumptions about strings. When you assign a Ruby object to a `char*`, Rubex will automatically pass a pointer to the C string contained inside the object to the `char*`, thereby increasing the efficiency of operations on the string. The resulting string is a regular `\0` delimited C string.
791
+
For purposes of optimization and compatibility with C, Rubex makes certain
792
+
assumptions about strings. When you assign a Ruby object to a `char*`, Rubex
793
+
will automatically pass a pointer to the C string contained inside the object
794
+
to the `char*`, thereby increasing the efficiency of operations on the string.
795
+
The resulting string is a regular `\0` delimited C string.
792
796
793
-
It should be noted that strings MUST use the double quotation syntax (`""`) and not single quotes in all cases. Single quote is reserved for use by C `char` data. For example, to assign a literal value to a C char, you can write `char a = 'b'`, to assign a literal C string to a `char*` array, use `char* a = "hello"`.
797
+
It should be noted that strings MUST use the double quotation syntax (`""`) and
798
+
not single quotes in all cases. Single quote is reserved for use by C `char` data.
799
+
For example, to assign a literal value to a C char, you can write `char a = 'b'`,
800
+
to assign a literal C string to a `char*` array, use `char* a = "hello"`.
794
801
795
802
# Differences from C
796
803
797
-
* Rubex does not have dereferencing operator (`*`). Instead use `[0]` to access values pointed to by pointers.
798
-
* There is no `->` operator for accessing struct elements from a pointer to a struct. Use the `.` operator directly.
804
+
* Rubex does not have dereferencing operator (`*`). Instead use `[0]` to access
805
+
values pointed to by pointers.
806
+
* There is no `->` operator for accessing struct elements from a pointer to a struct.
0 commit comments