I think it's because you haven't returned anything from main()
when I tried return count; , it didnt return anything if not the error
It will return automatically
arraynum is uninitialized, make sure that all objects are initialized
Initialised in the sense ?
Of course you'll smash the stack. arraynum could have any garbage value since you don't initialize it. \(_-_)/ What do you think will happen if arraynum is -1?
Use RUST... and it wouldn't compile.
That's not a good advice imo, using another language doesn't prevent from footguns. Rust does it to a large extent but not always.
Also, always preventing suspicious code is not always desirable
I am pretty sure I just need 1 extra keyword to make this kind of thing compile in Rust, just as easy to type by an inexperienced beginner
Yes, for example, implementing stackful coroutines is mighty suspicious looking
It is pretty much what your personality routines for exception handlers do. So basically the coroutine handle will have a pointer to the stack frame and everytime an await is called in the current async function, the caller is returned to the stack frame corresponding to the function that called this async function. There are some corner cases of course but nothing that can't be handled.
Int array[arraynum] should come after cin>> arraynum or use pointers
Not to mention the handling of calling convention. I have to admit to cheating on that in my own implementation by forcing a normal pseudo function call with no argument that forces register preservation for caller side
What are you using to write code?
Обсуждают сегодня