|
|
Without an explicit return statement, functions default to returning an int . What compile level are you using? I always use level 4.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Me too and that was my first thought. How did that even compile?
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Might not wanna help him. This is the third time he's posted a programming question in the lounge. And from what I've seen the forums, he's not doing much better there either.
Jeremy Falcon
|
|
|
|
|
That's what I was going to private email someone about yesterday.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
I have never look for "compile level", but I 'll try to find it...
Do you mean any function will return int or just when it is declared as returning
int specifically ?
I will have to go see if I actually used the return value...
But since few souls mention this not to post programming questions
I hesitate to post the actual code...
int TEST ( int test )
{
}
for those who needed the code
please note
THERE IS NO "return test;"
WHOOPS
I did not format it properly...
(time to get banned ...)
|
|
|
|
|
Even with all warnings disabled, the compiler should throw an error. ( visual studio and C++)
int Patate()
{
}
goto one of the programming forum and post minimal code that reproduce the problem.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Dude, this is like the third time. Clearly it's intentional now. You are expecting too much since this is the lounge.
Jeremy Falcon
|
|
|
|
|
Jeremy Falcon wrote: Clearly it's intentional now. Was it even a doubt before? Alone how the messages are phrased...
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Seems like something like this question was discussed not that long ago.
Salvatore Terress wrote: define C function to return int...
So C and not C++.
Per the following at least as far as the C11 spec this is allowed. I did not verify the spec myself.
https://stackoverflow.com/questions/10079089/implicit-int-return-value-of-c-function[^]
As several replies suggest the behavior is undefined however if the caller attempts to use the value. That of course would include crashing.
But there could be other reasons for it crashing.
|
|
|
|
|
Wordle 1,040 3/6
⬜⬜⬜🟨🟨
🟨⬜🟨🟩⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,040 4/6
⬜🟨⬜⬜🟨
🟨🟨⬜🟨⬜
🟨⬜🟨🟩⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,040 4/6
⬜⬜⬜🟨⬜
🟨🟨⬜🟨🟨
⬜🟨🟨🟩🟨
🟩🟩🟩🟩🟩
|
|
|
|
|
⬜🟨⬜⬜🟨
⬜⬜🟨⬜⬜
⬜🟨🟨🟨🟨
🟩🟩🟩🟩🟩
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 1,040 3/6*
⬜🟨⬜⬜🟨
🟨⬜🟨🟩⬜
🟩🟩🟩🟩🟩
Happiness will never come to those who fail to appreciate what they already have. -Anon
And those who were seen dancing were thought to be insane by those who could not hear the music. -Frederick Nietzsche
|
|
|
|
|
Wordle 1,040 3/6*
⬜🟨🟨⬜🟨
🟨🟨⬜🟨🟨
🟩🟩🟩🟩🟩
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wordle 1,040 6/6
🟨⬜⬜⬜⬜
⬜⬜🟩⬜🟨
⬜⬜⬜⬜⬜
⬜🟨🟨🟨⬜
🟩⬜🟩🟩⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,040 4/6
⬛⬛🟨⬛🟨
⬛🟨⬛🟨🟨
🟨🟨⬛🟨🟩
🟩🟩🟩🟩🟩
Ok, I have had my coffee, so you can all come out now!
|
|
|
|
|
Wordle 1,040 4/6*
⬛🟨🟨⬛🟨
🟨🟨⬛🟨⬛
⬛🟨⬛🟨🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
|
Man, people need to realize they either need to start studying AI or get left behind.
Jeremy Falcon
|
|
|
|
|
Looks like future generations will experience more of augmented reality than 'real' reality.
Edit: Perhaps 'fictitious' reality is a better term compared to augmented reality.
modified 24-Apr-24 4:04am.
|
|
|
|
|
I understand what you mean by "Hollydeadwood"...but there's more to movies than just the visuals. Oh, wait...Hollywood producers haven't been reminded of that for a couple of decades now. Never mind.
In some instances, I can't help but think it did a good job finding an existing video that matches the description provided. In other instances, the descriptions are so specific, obviously no such video already existed. Or did they work backwards? Produce a video first, then come up with a prompt to make it look like it generated the whole thing out of nothing? It wouldn't be the first time this sort of thing was done to blow the minds of the gullible with deep pockets.
I've probably grown too cynical.
It's cute, for sure. But the real question is, if you give it a long enough script, is it gonna be able to produce something that goes beyond the novelty value?
|
|
|
|
|
Came across this bit of code in a review
int v = 2 >> 10;
Usually I just skim by stuff like this because I figure the programmer knows what they are doing. Then I went back and looked because it was specify a max size so I figured someone was being clever. And 'clever' doesn't mean good code.
Then I realized it definitely was not clever.
Always willing to question myself I started wondering if I was misreading it. Or if I had actually forgotten what the operator did. So I wrote code just to verify it.
If it hadn't been so weird and so wrong I wouldn't have spent that much time on it.
|
|
|
|
|
Maybe the author is just suffering of left-right confusion Poor soul just wanted to write 2k.
Mircea
|
|
|
|