Anonymous
i was happily learning C and i tried to implement a simple function, but i got 2 errors regarding pointers (even though i didn't learn about them yet) , can i post a screen here of the code + gcc errors?
Anonymous
or do i need to use pastebin or other similar tools?
BinaryByter
post a screenshot
Anonymous
klimi
you are returning array of chars
BinaryByter
you are returning an array from a function that expects to return a char
klimi
but you define the fuction to return just one char
Anonymous
how can i define it to return an array instead?
klimi
char * strinput
BinaryByter
no
BinaryByter
stop learning C
klimi
no?
BinaryByter
honestly
BinaryByter
learn C++
klimi
it is C
BinaryByter
and use std::string
BinaryByter
yes
BinaryByter
thats why he should stop
klimi
so my asnwer was good
Anonymous
but i wanted to learn C
BinaryByter
You don't
Anonymous
char * strinput
i tried that though ( tried to place * kind of randomly ) but it gave me a lot of errors
Anonymous
well, the same number but they are different
Anonymous
well, 1 is different
Pavel
so my asnwer was good
Isn't it UB to return a pointer to an array created locally?
Anonymous
Anonymous
here
Anonymous
i have also tried to make the char str as a pointer and to make arr a pointer and return it
BinaryByter
klimi don't try to help him get this to work
Anonymous
but it gave me other errors so i just removed that part
BinaryByter
BinaryByter
why not
teaching C nowadays is irresponsible
Anonymous
i want to learn C
BinaryByter
no
Do you have a reason to learn C and not C++?
Anonymous
i need it for Lua
Pavel
qt
I expected to hear it :( Trying it the second day, but feels so seek. Probably need to accept it, can't find anything better
Anonymous
and somebody suggested me C
BinaryByter
why
its old and teaches very bad programming habits
BinaryByter
why lua?
Anonymous
the vast majority of the software on linux is written in C
BinaryByter
so what
you will be a programmer that no company can use
Anonymous
dwm is written in C just like i3 is
BinaryByter
BinaryByter
linux is horrible
Anonymous
linux is horrible
it's wonderful
BinaryByter
L O L
BinaryByter
you have no idea
Anonymous
what do you think the OS in the screenshot is? windows?
BinaryByter
No
BinaryByter
you really don't know how bad linux is
BinaryByter
Oh well
BinaryByter
for starters: its a minix clone
BinaryByter
minix wasnt built for efficiency
klimi
its killing me
BinaryByter
what?
klimi
that linux is bad
klimi
cuz i use it
BinaryByter
I use it too
BinaryByter
because its usually the most up to date
BinaryByter
but if I need something secure, reliable and fast i'll use BSD
Pavel
i need it for Lua
C++ works very well with Lua. luabind from boost is awesome
Anonymous
BinaryByter
debian isn't
do you know what linux is?
Anonymous
no?
yes?
BinaryByter
a kernel?
is debian linux?
BinaryByter
yes?
then why call it lua if its c?