« first day (3894 days earlier)      last day (1037 days later) » 

12:16 AM
@TheShortestMustacheTheorem In this case, no, it wouldn't. But there are circumstances in which ++i is/would be faster than i++, so it's generally considered a good idea to use the prefix form when possible, and use the postfix form only when you really need to.
 
12:51 AM
@JerryCoffin OK. Noted. THank you very much!
Please ignore my code chat.stackoverflow.com/transcript/message/52409792#52409792 because I have found my misunderstanding.
I am practicing pointer and array manipulation. Here it is:
int B[2][3] = {
	{1, 2, 3},
	{4, 5, 6},
}; // array of array of int

void BFlatten()
{
	int *p = *B;	   //  	pointer to int : first row of array of array of int
	int *q = B[0];	   //	pointer to int : first row of array of array of int
	int *r = &B[0][0]; // 	pointer to int : the address of the first cell of array of array of int
	// Double Loop
	for (int i = 0; i < 2; i++)
	{
		for (int j = 0; j < 3; j++)
			cout << p[3 * i + j] << " ";
		cout << endl;
	}
	// Single Loop
	for (int i = 0; i < 2 * 3; i++)
Confusing...
 
1:08 AM
@TheShortestMustacheTheorem My immediate advice would be to not bother. It's much less a matter of understanding, and mostly a matter of being meticulous in tracing things through the code. But, if you really insist on fiddling with things like this, feel free to figure out what the following bit of code prints out, and only then run it to see if you figured it out correctly:
#include<stdio.h>

char *c[] = { "ENTER", "NEW", "POINT", "FIRST" };
char **cp[] = { c+3, c+2, c+1, c };
char ***cpp = cp;

main()
{
    printf("%s", **++cpp);
    printf("%s ", *--*++cpp+3);
    printf("%s", *cpp[-2]+3);
    printf("%s\n", cpp[-1][-1]+1);
    return 0;
}
Plenty to confuse, distilled down to only a few short lines of code...
 
@JerryCoffin: It is interesting. It will be my homework. I will let you know my answer without compiling of course.
 
@TheShortestMustacheTheorem The correct answer it quite apropos...
 
OK. Thank you. Noted: The advantage of using complicated pointer arithmetic is that it trains us to be meticulous in life.
 
1:24 AM
@TheShortestMustacheTheorem I dunno. I can figure out things like this, but I don't maintain that kind of focus most of the time.
 
I passed the first printf: ++cpp=> cpp+1, *++cpp = cpp[1]= c+2, **++cpp= *(cpp[1]) = c[2] = "POINT"
 
@TheShortestMustacheTheorem good start.
 
Thank you!
The second printf is confusing. I don't know the precedence of +3. I think I have to rethink it later.
I also don't understand the negative index. I think C++ does not use negative index used in other languages such as python or wolfram.
OK. I think I have to go to work. See you later. Thank you!
 
1:53 AM
@TheShortestMustacheTheorem It can use a negative index, but it's not like Python, where a negative index works backward from the end. It just works like usual, indexing from where the pointer points to.
 
 
4 hours later…
5:31 AM
The last message was posted 1000 centuries ago.
 
6:00 AM
@TheShortestMustacheTheorem How dare you exaggerate like this. It was only 999 centuries ago!
 
@JerryCoffin Sorry, it is due to off-by-one error as usual.
I am struggling with a physics problem right now: physics.stackexchange.com/q/389548/93124.
 
@TheShortestMustacheTheorem 'fraid it's been way too long since my last physics class (1982 or '3) for me to even try helping with that one.
 
@JerryCoffin No problem. :-)
what is the best type for iterating index? size_t?
 
6:23 AM
std::size_t is commonly used for array indexing and loop counting.
 
some people have very strong opinions on whether it should be size_t or ssize_t
 
6:46 AM
@JerryCoffin I am guessing your year of birth. Is it around 1960-1962?
 
@TheShortestMustacheTheorem Close enough.
 
@JerryCoffin OK. Thanks.
 
7:28 AM
Morning
Jerry is supposed to be older than time itself
 
@Morwenn I am, but I've established a date/time suitable for paperwork purposes, to keep government bureaucrats happy.
It's like a kid's fake ID, but in reverse.
Getting more painful to establish ever generation though. Used to be all I had to do was move 100 miles down the road, give a new name, and my new identity was established. Nowadays, it takes almost a solid hour of hard work to forge papers for a new identity.
 
are your cheeks squishy
 
8:18 AM
hi
 
8:34 AM
hi
 
 
3 hours later…
nwp
They are super early on the April Fool's jokes this time.
 
so the thing is... it's not a joke
they are going to actually do a run of them
 
11:35 AM
probably the only way to get an xbox shaped thing into your house...
 
11:48 AM
I don't the supply situation there doesn't nearly seem as bad as PS5s or GPUs
 
nwp
"Sorry, we're out of green, used it all up for xboxes. Please don't buy any green markers the next few months, thanks."
 
12:06 PM
@PeterT MS planned their allocations better
that's basically what's happening, people didn't plan their allocations well. Whereas MS isn't afraid to make the xbox's and let them sit in a warehouse if necessary
 
a lot of companies they expected lower sales during covid but the opposite happened, and some companies didn't lower their allocation and were able to ride out the shortage because contracts guaranteed fab capacity for them
shipping issues might have been a thing but that's would still mean their product got made, only but delayed in shipping
 
@Mgetz I can imagine, they also bought a bunch to put in their data-center, so they could shift some of the inventory between cloud and retail as necessary
 
 
1 hour later…
1:27 PM
@Mgetz aye yaaey I'm from PlayStation Gang!!
 
 
4 hours later…
 

« first day (3894 days earlier)      last day (1037 days later) »