mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- `string::new_from_*` changed to `string::from_*`. - `String.to_utf16_copy` and related changed to `String.to_utf16`. - `String.to_utf16_tcopy` and related changed to `String.to_temp_utf16` - `mem::temp_new` changed to `mem::tnew`. - `mem::temp_alloc` and related changed to `mem::talloc`. - `mem::temp_new_array` changed to `mem::temp_array`.
26 lines
339 B
Plaintext
26 lines
339 B
Plaintext
import std::io;
|
|
|
|
struct MyStruct
|
|
{
|
|
DString* dyn;
|
|
}
|
|
|
|
fn void main()
|
|
{
|
|
@pool()
|
|
{
|
|
usz values_len = 10;
|
|
|
|
MyStruct ms = {
|
|
.dyn = mem::temp_array(DString, values_len).ptr,
|
|
};
|
|
|
|
for (usz i; i < values_len; ++i)
|
|
{
|
|
ms.dyn[i].tinit();
|
|
}
|
|
|
|
ms.dyn[0].append_chars("sad");
|
|
ms.dyn[0].append("sad");
|
|
};
|
|
} |