I want to have a small C program that checks if two strings are anagrams. Can you write me a function that does this?
system
main ek chota si program karnaa chahta hum jo jaanchataa he ki kya do taar enagram hai.kya aap mujhe ek fnction likh sakate hai jo aisa karata he?
user
bilkul!sabase aasaan tarika chaar code ke aadhaar par ek saahchary sarani kaa upyog karnaa he.yahan ek namoona karyanvayan he:

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>


#DEFINE ARR_LENGTH 26
#DEFINE CHAR_DIFF 97

bul kii tulana (int *arr1, int *arr2) {
for (int i = 0; i <arr_length; i ++) {
if (arr1 [i]! = arr2 [i]) juthi lauten;
}
sach lauten;
}

int *populate (char *s, int len) {
int * arr = malloc (sizeof (int) * arr_length);
for (int i = 0; i <len; i ++) {
// hamen sarani ke suchakaankon ko praapt karne ke liye ASCII code kaa upyog karen.udhaaharan ke liye, chunki 'e' 97 he, isliye ham sarani kii shuruyaat, 0 praapt karne ke liye char_diff ko ghataate hai.
arr [s [i] - char_diff] ++;
}
vaapasi giraftaar;
}

bul anagrams (char *s1, char *s2) {
// strings kii lambaai praapt karen.yadi lambaai samaan nahin he, to ham jaldi baahar nikal sakate hai, kyonki ve enagram nahin honge.
int len = strlen (S1);
if (len! = strlen (s2)) juthi vaapasi;
// sahyogi saraniyon ko aabaad karen.
int *arr1 = populate (s1, len);
int *arr2 = populate (s2, len);
// saraniyon ke madhyam se loop or samanta ke liye jaanch karen.
vaapasi tulana (Arr1, Arr2);
}

int main (int argc, char ** argv) {
// cmand line main kaarykram main paarit tarkon se hamaare do taar praapt karen.
char *s1 = argv [1];
char *s2 = argv [2];
bul hai_nagram = anagrams (S1, S2);
if (ran_anagrams) printf ("anagrams! \ n");
or printf ("enagram nahin! \ n");
}

dhyaan den ki code ke is sanskaran main truti handlling shaamil nahin he or bina tark ke chalaane par durghatnagrast ho jayega.
assistant
<|system|>
</s>
<|user|>
main ek chota si program karnaa chahta hum jo jaanchataa he ki kya do taar enagram hai.kya aap mujhe ek fnction likh sakate hai jo aisa karata he?</s>
<|assistant|>
bilkul!sabase aasaan tarika chaar code ke aadhaar par ek saahchary sarani kaa upyog karnaa he.yahan ek namoona karyanvayan he:

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>


#DEFINE ARR_LENGTH 26
#DEFINE CHAR_DIFF 97

bul kii tulana (int *arr1, int *arr2) {
for (int i = 0; i <arr_length; i ++) {
if (arr1 [i]! = arr2 [i]) juthi lauten;
}
sach lauten;
}

int *populate (char *s, int len) {
int * arr = malloc (sizeof (int) * arr_length);
for (int i = 0; i <len; i ++) {
// hamen sarani ke suchakaankon ko praapt karne ke liye ASCII code kaa upyog karen.udhaaharan ke liye, chunki 'e' 97 he, isliye ham sarani kii shuruyaat, 0 praapt karne ke liye char_diff ko ghataate hai.
arr [s [i] - char_diff] ++;
}
vaapasi giraftaar;
}

bul anagrams (char *s1, char *s2) {
// strings kii lambaai praapt karen.yadi lambaai samaan nahin he, to ham jaldi baahar nikal sakate hai, kyonki ve enagram nahin honge.
int len = strlen (S1);
if (len! = strlen (s2)) juthi vaapasi;
// sahyogi saraniyon ko aabaad karen.
int *arr1 = populate (s1, len);
int *arr2 = populate (s2, len);
// saraniyon ke madhyam se loop or samanta ke liye jaanch karen.
vaapasi tulana (Arr1, Arr2);
}

int main (int argc, char ** argv) {
// cmand line main kaarykram main paarit tarkon se hamaare do taar praapt karen.
char *s1 = argv [1];
char *s2 = argv [2];
bul hai_nagram = anagrams (S1, S2);
if (ran_anagrams) printf ("anagrams! \ n");
or printf ("enagram nahin! \ n");
}

dhyaan den ki code ke is sanskaran main truti handlling shaamil nahin he or bina tark ke chalaane par durghatnagrast ho jayega.</s>
