olli
Page 238
Anonymous
Sorry no wifi ...
it says in the note here that common initial sequence works with standard-layout structs
Anonymous
But then how is common intial sequence defined?
not important as we do not need it for none structs
Anonymous
if structs are used then we do need to garentuee that
Anonymous
if structs are not used we do not
Anonymous
Page 238
click on that 12.3 in blue in that line
olli
okay so you cannot write to u8 and read from u32
olli
=> UB
Anonymous
you can
Anonymous
if you use a union
olli
Where does the standard state this?
Anonymous
where does the standard state this is not allowed?
Anonymous
I use esp8266.. in this file used shifts (<<)..
yep and this came from the makers of es8266
Anonymous
which likely know a lot more about the xtensa then most people here
olli
where does the standard state this is not allowed?
At most one is active, in intro.object it's says for each change you create a new object. In basic.life it says the lifetime ends when the memory is reused. Furthermore the last part of the example in 12.3 states UB.
olli
C adds the "inspect as other data type" to allow type punning, C++ does not
BinaryByter
c++*
olli
I care what the standard allows me to do, not what it forbids
olli
c++*
Thx :) fixed
Anonymous
this does not apply to base classes
Anonymous
looking for intro.object
Anonymous
look sy yhsy shsin
Anonymous
Anonymous
see
olli
olli
Yes fine, using u.f afterwards is not
olli
You can't even use members of x as part of the union in the following
olli
To provide the full example
Anonymous
this is for structs
olli
Anonymous
you can if you do it correctly
but that i agree is UB
Anonymous
Yeah by std::launder
other ways you can do it
Anonymous
but that depends on the compiler
Anonymous
and other things
olli
Then you can't - I always talk in regard to the language and not the compiler
Anonymous
ok so here is another example tell me if this is undefined: union { int i; int j; };
Anonymous
and you use j as i
Anonymous
is this now undefined or just aliasing?
olli
is this now undefined or just aliasing?
Aliasing is undefined (expect object to Byte Arrays)
Anonymous
Aliasing is undefined (expect object to Byte Arrays)
then what is stopping us from saying that code is just doing that
Anonymous
because we are only working with byte arrays
klimi
Gn
Anonymous
hi guys! (c++)which could be the cause of a wrong difference's(or sum) result?
Anonymous
i mean why 3-(-4) give me 345768 for example
Anonymous
i don't know what it is but at least i have a cause to investigate
Anonymous
thx
Mihail
i mean why 3-(-4) give me 345768 for example
Can you show us your code? Take a screenshot or post it on pastebin
Anonymous
Hey i am a newbie c programmer, i want to ask, what pointer using for? I think pointer just give the variable address in memory
Otumian
I think there should be a group for C/C++ noobs
Anonymous
https://dhyan-foundation.blogspot.com/2018/11/why-is-vedic-civilisation-most-advanced.html?m=1&fbclid=IwAR2attU_T67Lt6DWkB6jAGanw-5fG3ZE74SjOV_zQaiKKfNn5MYPRE6nVj8
Avamander
I think there should be a group for C/C++ noobs
Try this: https://t.me/programminginc
Otumian
Leads me here
Anonymous
Can we use scope resolution operator in c language
Talula
you can write an OS in python provided you use Cython and build the base
Sure you can manage memory too and it'll be the slowest OS ever made.
Anonymous
faster then nodeos
Talula
nope
Maybe you can try to compare NodeJS with Python sometime and see the difference, NodeJS is actually faster.
Talula
Tried it... tested it... and compared it.
Talula
NodeJS is even faster than PHP on Web... it's slower than Go but faster than anything else other than Go and Rust.
S
How to work c++ programing
Talula
How to work c++ programing
That isn't even a question... I mean are you like coming here and asking the question because you heard C++ from someone in your school?
Nevermore
no Java?
amninder
Photo from Abhi
amninder
Photo from Abhi
Anyone to please explain how answer is 27.
Talula
That depends if your compiler takes int as 8 bit or 16 bit.
Talula
try changing int to long and see
Anonymous
5+2*5+2*5+2 is 27
Anonymous
thats why
amninder
Talula
5+2*5+2*5+2 is 27
Oh I didn't know it takes it that literal.
Stefan
add a quote on your macro substitute
Stefan
(5+2)