Ariana
2[a]
BinaryByter
thats just syntax
Alignant
thats just syntax
That is not recommeneded do be used because it's unsafe
BinaryByter
iirc, it doesnt work on every compiler
BinaryByter
thats what you mean
Alignant
thats what you mean
Sure I need to be more specific...
BinaryByter
Sure I need to be more specific...
unsafe != doesn'T work on every compiler
BinaryByter
in general, working with pointers is unsafe though
Ariana
in general, working with pointers is unsafe though
One of the reason why things are still being ‘hacked’
Ariana
Also why is %n a thing
Ariana
Actually i never understood %n
Ariana
Like genuinely confused when i learnt about it about the purpose
BinaryByter
Ariana
Yeah
BinaryByter
It just tells printf to emplace the first variadic argument on that place
BinaryByter
If it sees that char, it executes printf for the first variadic argument of type
Ariana
Doesn’t %n like write to memory
Ariana
In a function thats meant to print
BinaryByter
No it doesnt do anything
BinaryByter
Its just a text
BinaryByter
Look at the impl of printf
Alignant
But I'm not sure how formating specifiers have anything to do with hacking :D
olli
iirc, it doesnt work on every compiler
http://eel.is/c++draft/expr.post#expr.sub
Ariana
./test i=5 More testing,i=3 H3110 W0r1d,i=16 hmmm int i=5; printf("i=%d%n\n",i,&i); printf("More testing,i=%d%n\n",i,&i); printf("H3110 W0r1d,i=%d%n\n",i,&i);
olli
But I'm not sure how formating specifiers have anything to do with hacking :D
the problem are not formating specifiers but "unbound" input functions such as scanf
olli
%n Nothing printed. The corresponding argument must be a pointer to a signed int. The number of characters written so far is stored in the pointed location
Ariana
Fun part is you can rewrite all sorts of memory
Ariana
Well pointers are unsafe anyways
Alignant
%n Nothing printed. The corresponding argument must be a pointer to a signed int. The number of characters written so far is stored in the pointed location
You mean, she doesn't understand why printf("012%n", &n) requires a pointer to the int, not the int?
Ariana
No like why it exists
Alignant
What is the use of %n?
Ariana
Yeah
Ariana
There’s apparently some use for text aligning and thats all that i could find
Alignant
int main() { int a = 'a'; printf("0123%n56", &a); printf("\n %d", a); return 0; } It assignes the value of the its position in a string to a variable. the last print would print 4, not 97. But if you mean the practical use - I can't help xD
olli
it's useful for formatting purpose, e.g. to wrap lines or align
See
Hi
See
Its C being obsolete ?
Defragmented
Its C being obsolete ?
microcontrollers, universities, cavemen, and other reasons will still exist
Dima
it never will be obsolete
See
I want learn coding sockets in C and crosscompile for an embedded system
See
But i found so old books, they still useful for my propose?
Dima
only the size types
See
I know about pointers, memory,...
Ariana
C C++
Ariana
Assembly
Ariana
White space
Ariana
Its C being obsolete ?
It’s one of the most popular langs anyways
BinaryByter
BinaryByter
using C is asking for problems
Dima
using C is asking for problems
It’s embedded system
Dima
you shouldn’t use your bloated libs there
See
It’s one of the most popular langs anyways
You are right, i love C language , for me its easier than python or other, but on internet only talks about thw newers languages
BinaryByter
olli
most kernels are implemented in C
BinaryByter
you are creating an array but feeding it with an array of an array
BinaryByter
lol
Dima
wtf...
BinaryByter
wtf...
it's all fine
Alignant
I'll put an array in your array, so you can use your array while using your array...
See
I cant insert link but the book title is "Unix Network Programing volume 1 by W.RICHARD STEVENS" its still useful or outdated
See
Yes for useful or outdated XD
BinaryByter
I don't know
Dima
sockets api didn’t change, so it’s not outdated
BinaryByter
but I know that the assertion is true
Alignant
sockets api didn’t change, so it’s not outdated
True, but probably you want to use cross platform tools
BinaryByter
what's that?
Anonymous
no
Okay..
See
Is the only reference about socket i found, so im going diggin in it, thanks people