Talula
This is kinda improved version.
Talula
Where your y n works.
Anonymous
Hi
Anonymous
Hi
Nohello.com
Anonymous
how to enable undefined behaviour during execution in cpp?
Anonymous
Anonymous
g++ -Wall -Werror -pedantic-error fname.cpp
Anonymous
but this didn't work
Anonymous
Divide by zero and you will get one
My program is going out of bounds but My compiler isn't detecting it.
Anonymous
sorry it shouldn't be the job of compiler to find a UB, I guess at run time.
Anonymous
Use valgrind and profilers
Anonymous
Dynamic analyzers
Anonymous
Not necessarily
Ok, isn't the compiler's job limited before run?
Anonymous
I don't understand you
I mean the compiler should just be compiling thing and just that and shouldn't bother what is happening at run time
Anonymous
It should not, you must do it yourself
I want to know is there any way to enable the flags
Anonymous
UB has various forms And some can't be checked at compile-time
Ilya
Ok, isn't the compiler's job limited before run?
No, not a compiler job. Compiler does its best to do this but it cannot find all UB
Ilya
Is out-of-bounds one of those?
Many compilers now can provide run time checks for many but not all cases of UB. What compiler so you use?
Ilya
Ah, GCC...
Ilya
GCC is not the best here, but probably I just don't know
Ilya
Your can try MS VC Debug builds at least, or valgrind on Lin
Samuel
This is kinda improved version.
Thanks but can I pm for some clarifications
X3eRo0
well i am getting an error while compiling
X3eRo0
undefined reference to SetPixel@16
X3eRo0
i checked my system32 dir
X3eRo0
for gdi32.dll
X3eRo0
any idea?
X3eRo0
using mingw g++ compiler
Anonymous
undefined reference to SetPixel@16
Because you call function with wrong arguments
X3eRo0
SetPixel(hdc, x, y, RGB(127, x, y));
Anonymous
X3eRo0
thanks i will check now
X3eRo0
Check the documentation
according to https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-setpixel?redirectedfrom=MSDN
X3eRo0
it looks cool
Tobias🐾🚲
X3eRo0
yeah just saw that
X3eRo0
😂
X3eRo0
i want to like print pixels to my app based on the xy coordinates
X3eRo0
so
X3eRo0
can you guys suggest a better way
Anonymous
Can someone tell me how can I replace a word with another word in a file using command line argument
Anonymous
Isn't helping
Dima
It should
X3eRo0
hey
Anonymous
Helllloo
X3eRo0
pls suggest me a good way to draw pixels in a win32 gui application
Anonymous
#googleit
Tobias🐾🚲
pls suggest me a good way to draw pixels in a win32 gui application
https://www.libsdl.org/ But why pixels, and not a render target? And what for?
X3eRo0
like
Anonymous
Write a c++ program using command line argument to search for a word in a file and replace it with another word .
X3eRo0
i am modifying a 256*256 array of integers
X3eRo0
and i want to print those integers as colors like rgb (black-white) as each integer will be some color between black and white
Dima
Lol
Dima
bingo
X3eRo0
and the position of the color is the position of the color in the array
Tobias🐾🚲
Are you just doing rand() over it and want a pixel result from it?
X3eRo0
so is there any other way to do it without setpixel()
X3eRo0
colors[256][256] = {0,0,0,0,256,256,256,256......}
Tobias🐾🚲
so is there any other way to do it without setpixel()
Again, what precisely do you want to achieve?
X3eRo0
colors[256][256] = {0,0,0,0,256,256,256,256......}
i want to map these integers as pixels on the screen
X3eRo0
For what purpose. :P
well i want to convert these pixel values to something i can visualise
Tobias🐾🚲
well i want to convert these pixel values to something i can visualise
https://stackoverflow.com/questions/20579658/how-to-draw-pixels-in-sdl-2-0
Anonymous
OK so how do I develop AI using c++