why assertion will fail in BufferStream if const string size shorter than buffer size #1274
Unanswered
LukyGuyLucky
asked this question in
Q&A
Replies: 1 comment 1 reply
-
In this case, look at what you're doing: // For C:
libc::printf("large write failed #1: got %d;want %d.",n,DATA.len); This is almost fine, you're sending n (which is a number) and DATA.len (also a number) to printf. The problem is that if you use libc printf you need to use libc printf rules, so for an The second you try to use C3: io::printfn("large write failed #2:got %d,want %d",got,DATA) Now you are passing
As the error message says, there's an invalid argument type which has been passed to printf. If you change it to %s, or if you instead get the length (like in the libc::printf) it will just work. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://github.com/c3lang/c3c/blob/master/test/unit/stdlib/io/bufferstream.c3
It would be grateful if a FileStream library or example is provided.Manipulating file in a stream way is desired.
Thanks in advance.
It is great to know io::print family and c printf family has been integrated and simplified. I was wondering is there any difference between io::printf and lic::printf?And also it is great more STL functions and methods have been integrated into the handbook.But I failed to found int system(char* command) has been listed in(or put it in another way,how to keep the terminal window open to wait user input before the program exits?).
But unlucky since 0.60 I failed to compile cforms https://github.com/kcvinker/cforms /sqlite3/raylib examples discussed before.Would you please take a look at them and provide a workable example(s) when you are available?
Appreciated.
Beta Was this translation helpful? Give feedback.
All reactions