Message from C, C++ talks

June 2019

— I use it too

— 👍

— I use geany

— You aren't ending your string. You should add '\0' or simplly 0 once you're done writing to it.


So cout prints it until the \0 and so you get random values after NW753 which is what your program generated

— Also that code is kinda bad

— Use 2 for's and remove the switch

— Would be way better

— Oh and seeing it's C++, just use std::string

— And rand isn't good for generating random numbers, because it's not a uniform distribution

— Yes when i tried creating a game, everytime rand gives same order of numbers.🙄

— Did you initialize the seed?

— That might be a seed problem

— I mean, rand is not good, but it doesn't always give the same order 😆

— What is seed problem?