c-strings
Is it possible to print out only a certain section of a C-string, without making a separate substring?
Say I have the following: char* string = \"Hello, how are you?\"; Is it possible to print out only the last 5 bytes of this string? What about the f开发者_如何学JAVAirst 5 bytes only? Is there some[详细]
2023-04-13 01:36 分类:问答Understanding C-strings & string literals in C++
I have a few questions I would like to ask about string literals and C-strings. So if I have something like this:[详细]
2023-04-11 06:22 分类:问答Store two integers from a String in C
I am trying to write a program that prints two numbers from a string. For example, string = \'20,66\' I am trying to break this string apart so I can store \'20\' and \'66\' into two sepa开发者_开发问[详细]
2023-04-11 05:28 分类:问答Returning a String from function in C
char* clean_string (char *input_string){ /*Ensure that input string isn\'t null and only do heavy lifting if it\'s not null*/[详细]
2023-04-05 04:42 分类:问答Reverse a String
Basically I have a method that converts a decimal number to a number in a different base (ex, base 2), the element in position 0 of the array is the most significant, ex $100, The 1 is the most signif[详细]
2023-04-03 10:26 分类:问答Returning a dynamic C style string from a function?
Basically I have a function that roughly looks like this and I need to return out. const char* UTF16ToUTF8(const wchar_t *in) {[详细]
2023-04-03 03:10 分类:问答How do I concatenate multiple char strings in C? [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicate: C String Concatenation 开发者_高级运维[详细]
2023-03-31 12:32 分类:问答How do I return a variable size string from a function?
I need a working code for a function that will return a random string with a random length. What I want to do would be better described by the following code.[详细]
2023-03-31 07:20 分类:问答strncpy or strlcpy in my case
what should I use when I want to copy src_str to dst_arr and why? char dst_arr[10]; char *src_str = \"hello\";[详细]
2023-03-26 13:41 分类:问答regexec and regcomp more efficient than doing strncmp myself?
I have a string like this: I am down in the town seeing a crown=\"larry\" with a cherry=\"red\" I want to write a program that asks user what she wants. If she requests the string that should have[详细]
2023-03-23 01:38 分类:问答