What do you want to save?
Add Code snippet
New code examples
-
C 2022-03-24 20:20:01
C printf to string
// int sprintf(char *str, const char *format, ...); char *printf_to_string() { char buffer[128] = {0} //Must be big enough // writing printf output in buffer sprintf(buffer, "some %s here...\n", "text"); // duplicate if needed... Add solution -
Assembly 2022-03-22 20:55:01
printf format specifiers c
/* printf example */ #include <stdio.h> int main() { printf ("Characters: %c %c \n", 'a', 65); printf ("Decimals: %d %ld\n", 1977, 650000L); printf ("Preceding with blanks: %10d \n", 1977); printf ("Pr... Add solution -
C++ 2022-02-16 02:30:33
void *malloc( size_t size ) { //do your stuf here return ::malloc(size); }
/* malloc example: random string generator*/ #include <stdio.h> /* printf, scanf, NULL */ #include <stdlib.h> /* malloc, free, rand */ int main () { int i,n; char * buffer; printf ("How long do you want the string? "... Add solution -
Other 2022-01-22 16:45:53
octave endwhile if
The break statement jumps out of the innermost while, do-until, or for loop that encloses it. The break statement may only be used within the body of a loop. num = 103; div = 2; while (div*div <= num) if (rem (num, div) == 0) break; endif di... Add solution