title: how to make a not null-terminated c string?
body: <p>i am wondering :char *cs = .....;what will happen to strlen() and printf("%s",cs) if cs point to memory block which is huge but with no '\0' in it?
   i write these lines:</p>
  
  <pre><code> char s2[3] = {'a','a','a'};
  printf("str is %s,length is %d",s2,strlen(s2));
  </code></pre>
  
  <p>i get the result :"aaa","3",but i think this result is because that a '\0'(or a 0 byte) happens to reside in the location s2+3.
  how to make a not null-terminated c string? strlen and other c string function relies heavily on the '\0' byte,what if there is no '\0',i just want know this rule deeper and better.</p>
  
  <p>ps: my curiosity is aroused by studying the follw post on SO.
  <a href="https://stackoverflow.com/questions/8126498/how-to-convert-a-const-char-to-stdstring">How to convert a const char * to std::string</a>
  and these word in that post :
  "This is actually trickier than it looks, because you can't call strlen unless the string is actually nul terminated."</p>