English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i want to check whether the name already existed or not only c language

2006-08-29 02:05:38 · 6 answers · asked by ram 1 in Computers & Internet Programming & Design

6 answers

I'm not sure if I understand you or not. What I understood you as saying is the following: I would like to created a program (with C) that checks whether a name already exists or not. However, that doesn't tell me too much because 1) Are you using a database or list, 2) if you're using a list/array/vector/etc which type are you using? Basically, if you are using a string array, you just check to see if the input string is equal to any of the elements in the array.

Example: Arr is an array of N stringf elements, user has inputed string to check if it exists in the array or not, which has been stored in InString.

int exists=0;
for(int i=0; i {
if(Arr[i]==InString) exists=1;
}

....or something like that. Hope that helps!!!

2006-08-29 02:28:02 · answer #1 · answered by MJPM 2 · 0 0

Your Q is not clear. Do you mean to ask if there is a book named "write c program" or something else....

2006-08-29 02:20:23 · answer #2 · answered by rony 1 · 0 0

Why do not you in ordinary words upload a non everlasting variable? ok, purely thinknig about it, this works: (this would all be pseudo code because i am going to't bear in mind C) Variables will be stated as var1 and var2. var1 = var1 + var2 var 2 = var1 - var2 var1 = var2 - var1 each step being executed after the previous one. wish it helps.

2016-12-05 21:20:14 · answer #3 · answered by ? 3 · 0 0

u can use the strcmp() function which compares two strings. like
if(strcmp(str1,str2)==0)
puts("strings r equal");
else
puts("not equal");

if u r using array then u can use any count variable say i in for loop.
for(i=0;i {
if(strcmp(str1[i],str2)==0))
puts("str2 already existed");
}

plz modify acc. to ur specifications & don't forget to include string.h

2006-08-29 03:24:29 · answer #4 · answered by knu 1 · 0 0

your question is not clear. need some more details to answer
be specific about wat u are asking is it a c program or as told a book.

2006-08-29 03:59:44 · answer #5 · answered by Aarthi R 2 · 0 0

can you explain

2006-08-29 03:12:58 · answer #6 · answered by Jarray 1 · 0 0

fedest.com, questions and answers