Questions tagged [memcmp]

memcmp is a function available in the string.h library.

Official Definition

The memcmp() function compares the first n bytes (each interpreted as unsigned char) of the memory areas s1 and s2.

Syntax of usage

#include <string.h>
int memcmp(const void *s1, const void *s2, size_t n);

Source

Linux Man Pages

106 questions
-5
votes
2 answers

memcmp compare two void pointers which contain strings

I have next problem. I used int memcmp ( const void * ptr1, const void * ptr2, size_t num ); function to compare two void pointers which contain integers. This worked for me very well. int firstValue = 5; int secondValue = 3; void*…
user2962977
  • 21
  • 2
  • 5
1 2 3 4 5 6 7
8