Top "C-strings" questions

A string in the programming language C is represented as a sequence of characters followed by a null terminator (represented as \0).

Comparing two char* for equality

Possible Duplicate: What is the proper function for comparing two C-style strings? My match condition doesn't work! Can someone advise …

c++ c-strings
What is the difference between memcmp, strcmp and strncmp in C?

I wrote this small piece of code in C to test memcmp() strncmp() strcmp() functions in C. Here is the …

c string c-strings
Expand macros inside quoted string

Possible Duplicate: C Macros to create strings I have a function which accepts one argument of type char*, like f("…

c macros c-preprocessor c-strings
Selecting only the first few characters in a string C++

I want to select the first 8 characters of a string using C++. Right now I create a temporary string which …

c++ string c-strings
converting c style string to c++ style string

Can anyone please tell me how to convert a C style string (i.e a char* ) to a c++ style …

c++ c-strings
strstr to find a word in a string using c returning true all the time

Good Day, So I decided to go trough my C again and started making a simple search the word in …

c c-strings turbo-c
Print part of a string in C

Is there a way to only print part of a string? For example, if I have char *str = "hello there"; …

c c-strings
Implementation of strcmp

I tried to implement strcmp: int strCmp(char string1[], char string2[]) { int i = 0, flag = 0; while (flag == 0) { if (string1[i] > …

c c-strings strcmp
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 *…

c copy c-strings strncpy
Why is strdup considered to be evil

I've seen some posters stating that strdup is evil. Is there a consensus on this? I've used it without any …

c c-strings