Click here to Skip to main content
15,891,253 members

Comments by Rick York (Top 200 by date)

Rick York 16hrs ago View    
I have used the unordered_map several times and I consider it to be very, very high performance. I have a program that puts 12K file names in a map where the first few dozen characters were all the same and it read them all from the directory in less than twenty milliseconds. I can't think of a reason for needing better performance than that. I really couldn't care less how much of the CPU it uses to do that and I can't think of a good reason why that should matter.
Rick York 3 days ago View    
That works until someone enters 100 characters and then they have an unterminated string. This is why I prefer the #define (or a const int) and the declaration to be char a[MAX_BUFFER+1]={0}; The +1 leaves room for the null character and the rest of the code doesn't change. Also, initializing it adds the null every time, including when building in release mode. If sizeof is used then a -1 is needed to be safe.
Rick York 4 days ago View    
I wrote the code the way it is specifically so I could avoid setting the null character. Initializing the buffer that way means you do not have to because it's taken care of. Using the strncpy function with the appropriate size insures that the terminating null character is not touched. THAT is why the type is defined with the +1 - it simplifies the code.
Rick York 4 days ago View    
I used the code presented here successfully : https://www.codeproject.com/Articles/34508/WinAES-A-C-AES-Class
Rick York 25-Apr-24 2:35am View    
I probably can but this isn't my homework.