Top "Strcmp" questions

strcmp is a string compare function that is available in languages such as C, C++, PHP, Python and MATLAB.

How to properly compare command-line arguments?

I am trying to write a C code which takes arguments in main; thus when I write some strings in …

c string command-line-arguments string-comparison strcmp
In C how to strcmp just the beginning 2 characters and then concatenate?

In C how do I strcmp just the beginning 2 characters? Then concatenate with another string? Something like this: char s[10]; …

c string string-comparison strcmp strncmp
Why is strcmp unknown to clang?

I have a basic program that compares two strings : #include <string> #include <iostream> using namespace std; …

c++ clang strcmp
Why is strcmp not SIMD optimized?

I've tried to compile this program on an x64 computer: #include <cstring> int main(int argc, char* argv[]) { …

c++ sse simd strcmp sse2
Checking the first letter of a string in c

I am writing a very simple function in C to check if a string is an absolute path or relative …

c strcmp strncmp
When will strcmp not return -1, 0 or 1?

From the man page: The strcmp() and strncmp() functions return an integer less than, equal to, or greater than zero …

c strcmp
C- Checking if the first character in the first comand line arguement contains a particular char

If the first character of the first argument == "-" then enter the if statement. The error I get is "passing …

c pointers casting strcmp fgetc
Why use strcmp instead of == in C++?

I wonder my code works perfectly fine either using strcmp or simply == in C++ for comparing 2 char arrays. Can any …

c++ strcmp
How to make strcmp to return 0 in assembly

I want the call to the strcmp function to return 0, which means int strncmp(const char *s1, const char *s2, …

c assembly x86 strcmp