VJ
post increment doest not update value of previous existing variable is that correct??
Dima
both are kek
BinaryByter
S.
post increment doest not update value of previous existing variable is that correct??
it's undefined behavior, which means, it can act differently with different compilers.
Anonymous
but it'd be an ub
Yeah, that too. Could violate sequencing rules.
S.
Verified.
Anonymous
But still, post and pre in/decrement do different stuff, that is what he should learn first if he doesn't know the basics^^
S.
S.
for gcc ... output is
S.
TRUE 1
S.
S.
but for tc, output is TRUE 2
S.
JUST STOP WRITING CODE LIKE THIS
S.
Pick up a decent book
VJ
JUST STOP WRITING CODE LIKE THIS
as i said am preparing for company thats y am asking
Anonymous
s but questions seems to be little tricky that's y am asking
First, learn the basics, second learn how to use this basics correctly. Don't write professional code before step 2.
S.
as i said am preparing for company thats y am asking
Then the only correct answer is, "undefined behavior"
S.
To be a little more professional, you can answer "violate sequencing rules"
Dima
that doesn’t look like a company assignment, just not a decent book assignment given in university lol
Mihail
More like a basic thing
swarnim
wat?
https://stackoverflow.com/questions/2872543/printf-vs-cout-in-c/20238349
swarnim
Also how is that a secret?
Well it's basic when you know it, the thing about basics is that nobody tells you about it. So it becomes a secret for people who don't know it.
Dima
printf ftw
Dima
/ban no
swarnim
Please don't debate printf vs cout any further it's simply a fact that printf is noticeably faster. Nothing more. Rest is just preference.
Dima
Yos
Dima
Maxi’s favorite using namespace std; cout << “look at me I am using namespace”;
Anonymous
Dima
I got triggered myself while writing it
Anonymous
xD
Saurabh
I have a confusion Please sort it out
Saurabh
Dima
qsort();
Saurabh
Saurabh
This is write black image
Anonymous
Oof, another one who can't paste code
Saurabh
But how to dump
S.
Learn how to paste code
Saurabh
Ok
Saurabh
I am pasting
Anonymous
It's getting worse...
Anonymous
xD
Mat
Pinned message please
swarnim
but i just made a test vm ;_;
Ok just one more.😜😂
Saurabh
https://pastebin.com/SvTHPf9b
Saurabh
This is the write black image
Saurabh
But how to dump
Dima
stop asking the same question
Talula
But how to dump
Make sure you feel like you'll dump, if you haven't dumped for 2-3 days check with your doctor, go sit on the toilet seat for few minutes and stress your dyframe, it's not hard even babies dump.
Talula
Stupid question, define dump first... dump where?
Saurabh
Dump in a buffer
Talula
Write to a file, display on screen, put in memory?
Talula
You're already writing it to buffer... any stream of memory is a buffer...
Talula
Do you want to load the file?
Talula
And display it as bitmap?
Saurabh
Then what is the difference in both questions
Saurabh
ppm format
Saurabh
In .ppm file
Talula
There is no such thing as ppm format, what you're doing in the program is simply writting 0s to a file
Talula
And you're writing as "%d" that means it's going to be actually ASCII '0'
Saurabh
My program is not correct .It may be wrong
Talula
Not /0
Talula
But there is no such thing as PPM format
Dima
there is
Saurabh
It is plane ppm format and in this ppm we write image by ascii value
Talula
At least not in my knowledge.
Talula
Yeah but you have written the file, now what do you want to do with it?
Saurabh
http://netpbm.sourceforge.net/doc/ppm.html
Saurabh
Ppm format
Talula