c-strings
How can I check if a string has special characters in C++ effectively?
I am trying to find if there is better way to check if the string has special characters. In my case, anything other than alphanumeric and a \'_\' is considered a special character. Currently, I have[详细]
2023-03-18 01:47 分类:问答How to write a better strlen function?
I am reading \"Write Great Code Volume 2\" and it shows the following strlen impelementation: int myStrlen( char *s )[详细]
2023-03-17 04:47 分类:问答ReadFile weird behavior when buffer is CString
I have inherited code using ReadFile Windows API method to read single byte from parallel port in a loop.[详细]
2023-03-16 04:40 分类:问答What is the lifetime of the result of std::string::c_str()?
In one of my programs, I have to interface with some legacy code that works with const char*. Lets say I have a structure which looks like:[详细]
2023-03-15 11:24 分类:问答C++0x Function delete - Delete all but certain types
In C++0开发者_如何学Gox, I can do something like this: double f(double x) { return x; } template<class T>[详细]
2023-03-10 07:10 分类:问答How to initialize c-strings array (no stl)
I want to initialize array of c-strings with zero pointers in MSVC2010 // Foo.h #pragma once class Foo {[详细]
2023-03-08 10:33 分类:问答How to compare characters in c
I have a small project i am doing that requires comparing the first byte of a stream. The problem is that that byte can be 0xe5 or any other non printable character, and thus denoting that that partic[详细]
2023-03-01 04:11 分类:问答In C, how to remove all characters present in one array from another array?
In C, how to re开发者_StackOverflowmove all characters present in one array from another array?Sounds like homework but here\'s a solution.[详细]
2023-02-14 13:52 分类:问答Interpreting App Verifier output: Heap corruption or misinterpreting stack address as heap address?
We have a test case that crashes our big MFC-based app with a heap corruption error. I turned on the page heap using App Verifier for the DLL in question (turning the heap on for the entire process i[详细]
2023-02-12 06:30 分类:问答MFC CString Format gives weird behaviour
I am having a weird problem with CString I have the following code which gives an unexpected result: CString sourcePath = _T(\"C:\\\\some\\\\path\\\\file.ext\");[详细]
2023-02-10 15:21 分类:问答