Mity
Yes
Mity
When i use malloc and run program it says segmentation error
Mity
malloc for Int work fine
Raz
When i use malloc and run program it says segmentation error
Well, we should see your code, and get more details about the error (in which line, or something). How have you used malloc?
Daniele°
Guys can you tell me to allocate dynamic memory in c for string
#define MANY(T,N) (T*)malloc(sizeof(T)*(N)) char* str=MANY(char,80); strcpy(str,"hello world!"); puts(str);
Mity
Okay... I'll send the codes tomorrow
Raz
Maybe... you did not allocate enough memory? For int you did something like malloc(sizeof(int)) For string, you should multiply by the number of characters you want to allocate, like malloc(sizeof(char) * 10)
Raz
If you want 10 characters, including the 0 at the end, you should multiply the size of char by 10
Mity
Ahah
Daniele°
Don't use macros
Peace and love
Anonymous
Daniele°
Macro Is a text replace
Anonymous
Macro Is a text replace
And is a bad practice
Daniele°
If you Need to rewrite a text every time you Need a macro
Daniele°
Anonymous
Macros are ugly and bug prone
Daniele°
No
Anonymous
No
Yes
Daniele°
C++ Is a big C macro
Anonymous
C++ Is a big C macro
Hahahahahahahaah
Anonymous
You're so funny
Daniele°
#define new(t) (t*)malloc(sizeof(t)) int* funny = new(int);
Anonymous
#define new(t) (t*)malloc(sizeof(t)) int* funny = new(int);
Well, so what? If you know nothing about c++, it's better to say nothing
Anonymous
C++ is not only about new/delete
Anonymous
C++ is not only about new/delete
If you think so — you are a noob
kλletaa
the word noob in 2019
kλletaa
cringe
Daniele°
If you think so — you are a noob
if( c ){ __autofree char* world = strdup("hello"); puts(world); }
Ludovic 'Archivist'
the word noob in 2019
You prefer newbie?
kλletaa
You prefer newbie?
i prefer "retarded" or "fucking disabled"
Daniele°
Wat
Raii in C
Ludovic 'Archivist'
C++ Is a big C macro
Are you a time traveler from 1986, because that is completely false since 1987
Anonymous
Raii in C
Is it standardized? I don't think so
Anonymous
No, dialect
So it's not a valid example
Anonymous
Now show us some metaprogramming in C
Ludovic 'Archivist'
C++ Is big C macro, C is a big assembly macro
If you want to think so, programming languages do not exist and are all handy macro systems around binary
Anonymous
If you are so expert, mister "my macro doesn't work, but I know everything about c++"
Anonymous
learn nim
What is it?
Ludovic 'Archivist'
What is it?
Yet another C alternative
kλletaa
compiles to c, but it's not a pain in the ass :^)
Ludovic 'Archivist'
Yaca for short
kλletaa
it's like c but without the undefined behaviour
Ludovic 'Archivist'
it's like c but without the undefined behaviour
Well I would like to know how it enforces endianness across platforms
Daniele°
So it's not a valid example
Works on gcc, icc and clang, msvc can suck's
Nameful
Anonymous
compiles to c, but it's not a pain in the ass :^)
Well There's a cool language called C++ Compiles to machine code And every three years it becomes less pain in the ass I prefer this
kλletaa
No
suck my cock oldbyte go boom in lounge retard
Anonymous
Works on gcc, icc and clang, msvc can suck's
Dude If you're using not a standard language, you a bad programmer
Ludovic 'Archivist'
kλletaa
/report?
ok incel
Ludovic 'Archivist'
ok incel
Lol, I am recently single of my own accord xD
kλletaa
All rust developer are a bad programmer?
dude just rewrite linux in rust bro
Dima
Anonymous
All rust developer are a bad programmer?
We are talking about c and c++ here I don't give a fuck about Rust
Daniele°
Yes
Anonymous
You are so expert But even your macro is bad
Ludovic 'Archivist'
no
Erm, gnu extensions everywhere but okay
kλletaa
gnu owns me and all
Daniele°
no
Build on clang after many years and many patch
Ludovic 'Archivist'
gnu owns me and all
No, it is just exactly what the dude said, not standard C, C with GNU extensions
kλletaa
Build on clang after many years and many patch
compile my dick up your ass after years of dilation
kλletaa
boonk gang
kλletaa
whole lotta gang shit
Daniele°
You are so expert But even your macro is bad
Linux kernel use a macro same *bsd