Is this undefined behavior for this?
char *a = "hello"; char b[] = "abcd"; a = b;
My compiler does not generate warnings with a maximum warning level.
There is no UB. You simply reassign the pointer to point to the start address of the array.
Please note that you do not actually change the value that it points to a, only a, but ais normal char *.
a
char *
Source: https://habr.com/ru/post/1665046/More articles:React Native file handling - delete image - delete-fileExtract data from a specific PDF position? - rCircle fading in a circle - cssMVVM Too many properties - c #Why is Cocoa a Touch Umbrella Header not automatically generated based on common frame headers? - objective-cHiding divs on small devices with Bootstrap 3.1.0 - cssHow to build a linear function using Gadfly.jl in Julia? - graphHow to disable a specific rule in FSharpLint? - buildCreating a C # visual studio with fragments with interface / annotations / link / use? - c #Bash ัะฑะพะน ะฑัััััั ััะฝะบัะธะน - bashAll Articles