Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
strcmp
- Page 1
Re: strcmp
Programming
Software Development
13 Years Ago
by deceptikon
strcmp
returns the difference of the two strings. If the first …
Re: strcmp doesn't work... =(
Programming
Software Development
18 Years Ago
by Ancient Dragon
strcmp
() only works with NULL-terminated charqcter arrays -- it does not work with binary data or strings that are not null terminated. Other than that, post your code to illustrate what you want to do.
Re: strcmp question
Programming
Software Development
13 Years Ago
by Ancient Dragon
strcmp
() won't work for you because it expects an exact …
strcmp help
Programming
Software Development
17 Years Ago
by Cosa
…int i=0; i<numrec; i++) { if (
strcmp
(SubscriberID[i].Subscriber_Address.streetname, searchaddress) == 0); { cout &…char*’ error: initialising argument 2 of ‘int
strcmp
(const char*, const char*)' I get this… error wen using "
strcmp
(SubscriberID[i].Subscriber_Address.streetname, searchaddress) == 0);&…
Re: strcmp help
Programming
Software Development
17 Years Ago
by vmanes
… string type to get a c-style string for the
strcmp
function. This method returns a char*. [code] std::string searchaddress…; std::string newaddress; if (
strcmp
( newaddress.c_str(), searchaddress.c_str() ) == 0) [/code] But, as long as…
Re: strcmp help
Programming
Software Development
17 Years Ago
by Cosa
The compare is more like this [code]
strcmp
(SubscriberID[i].Subscriber_Address.streetname, searchaddress)[/code] So its comparing the … like this? [code] std::string searchaddress; std::string newaddress; if (
strcmp
( SubscriberID[i].Subscriber_Address.streetname, searchaddress.c_str() ) == 0) [/code] If i…
Re: strcmp help
Programming
Software Development
17 Years Ago
by Cosa
[code]error: cannot convert ‘std::string’ to ‘const char*’ for argument ‘2’ to ‘int
strcmp
(const char*, const char*)’ [/code] I get this error if i use std::string searchaddress; std::string newaddress; And #define isnt supposed to be used in this program. Any other ideas?
Re: strcmp help
Programming
Software Development
17 Years Ago
by Cosa
…; name; for(int i = 0; i < numrec; i++) { if(
strcmp
(SubscriberID[i].Firstname,name) == 0 ) { cin.clear(); cin.ignore(100…
Re: strcmp
Programming
Software Development
15 Years Ago
by Nogat21
…[i] << endl; //cout<<
strcmp
(value,gen_arr[i])<<endl; if (
strcmp
(value, gen_arr[i]) == 0 ){ file.seekp… strcpy: [code=cpp] char newValue[30]; strcpy(newValue,value); if (
strcmp
(newValue, gen_arr[i]) == 0 ){ //(...) [/code] But the result remains the…
strcmp
Programming
Software Development
13 Years Ago
by rithish
…); printf("enter the string 2 : "); gets(cmp); x=
strcmp
(str,cmp); printf("%d",x); } [/CODE] my doubt… is how
strcmp
returns an integer ??how will it take the words
strcmp
Programming
Software Development
15 Years Ago
by Nogat21
… _stricmp for case insensitive comparison, but even with the conventional
strcmp
i'm not getting the result i want. [code=cpp…
strcmp Error
Programming
Software Development
15 Years Ago
by William Byrd II
… numberHolder = number.dataNumber; string nineNineNine = "~"; if(
strcmp
( aNames[ 999 ], nineNineNine ) == 0 ) {} else { throw…for( int i = 0; i < 1000; i++ ) { if(
strcmp
( aNames[ i ], nameHolder ) == 0 ) { throw NameAlreadyAddedException(); } if(…
Re: strcmp Error
Programming
Software Development
15 Years Ago
by WaltP
You can't use a string object with [iCODE]
strcmp
()[/iCODE]. 2 solutions: 1) use the compare method that's part of the string object 2) convert the string object to char* with [I]stringname.[/I][B]c_str()[/B]
Re: strcmp Error
Programming
Software Development
15 Years Ago
by chary8088
two parameters of
strcmp
type must be char * ,not string
strcmp not working
Programming
Software Development
11 Years Ago
by mixelplik
…0) { teams[0].losses += 1; } } if(
strcmp
(teams[numTeams - 1].name, team) == 0) {…{ teams[med].losses += 1; return; } } if(
strcmp
(teams[med].name, team) > 0) { high…
Re: strcmp without cast
Programming
Software Development
19 Years Ago
by frenzy44
…;, firstname[j], lastname[j]); int b =
strcmp
(firstname[j], emp[a].last); int c =
strcmp
(lastname[j], emp[a].first); if (b… == 0 && c == 0) //
strcmp
(firstname[j], emp[a].last) == 0) // &&
strcmp
(lastname[j], emp[a].first)==0…
strcmp without cast
Programming
Software Development
19 Years Ago
by frenzy44
… i get the error "Warning: passing arg 1 of '
strcmp
' makes pointer from integer without a cast" i actually… IS WHERE ITS MESSING UP int b =
strcmp
(firstname[j], emp[a].last); int c =
strcmp
(lastname[j], emp[a].first); if…
strcmp not comparing strings
Programming
Software Development
16 Years Ago
by lameassthemity
…;); } else { for(int x=0; x<=currentindex; x++) { if (
strcmp
(Course[x].ClassNumber, query) == 0) { cout << "Class… variable I declare ClassNumber or query as,
strcmp
gives me the following error: error C2664: '
strcmp
' : cannot convert parameter 1 from 'std…
strcmp in php to check variables
Programming
Web Development
12 Years Ago
by DaveyMoyes
Hi everyone, I have been using
strcmp
in a website I am helping with, we use this … the moment is, when ever i try to use the
strcmp
to check against numbers It always says the numbers are… how I am checking if both numbers are correct . if(
strcmp
($lastfour, $cnumber) != 0 ) Cheers DM :)
Re: strcmp question
Programming
Software Development
14 Years Ago
by Colezy
…wish to modify your code to use strtok and
strcmp
. I can see why you need strtok but I… don't fully understand what you want
strcmp
for? are you looking to check for the strings…section = strtok(buffer,','); while (section != NULL){ if (
strcmp
(section,'103') == 0){ //
strcmp
returns 0 if values are identical //person found IDNum…
Re: `strcmp' makes pointer from integer without a cast
Programming
Software Development
14 Years Ago
by UrbanBourbon
…]Shouldn't this line be if((
strcmp
(first, workers[L].first) == 0) && (
strcmp
(last, workers[L].last) == 0…)) calling
strcmp
twice. Also your error...first and last are…QUOTE] Ok thanks. Yeah I forgot about the other '
strcmp
'. If you don't mind me asking what should …
strcmp of 2-D array
Programming
Software Development
20 Years Ago
by idr1978
… trying to run an IF statement similar to this: if (
strcmp
(Training[0][0], "1")==0) { printf ("Successful… dump whenever I run it. Can't I use "
strcmp
" like this? Please help!! I've been working on…
Re: strcmp of 2-D array
Programming
Software Development
20 Years Ago
by Narue
…; like this? Not if Training[0][0] is a character.
strcmp
compares strings, and a character is not a string. Use…
Re: strcmp without cast
Programming
Software Development
19 Years Ago
by Bench
…. firstname[j] is a single character - the problem is that
strcmp
is expecting a whole string, ie [I][COLOR="Blue…
strcmp error
Programming
Software Development
17 Years Ago
by mosullivan
… a similar program and am getting an error that states '
strcmp
' cannot convert parameter 1 from 'const char' to 'const char…; j++) { for (i = i + 1; i < N_STRINGS; i++) { if ((
strcmp
(p[j], p[i])) > 0) printf("yes"…
Re: strcmp error
Programming
Software Development
17 Years Ago
by Aia
[QUOTE]if ((
strcmp
(p[j], p[i])) > 0)[/QUOTE] [B]p[j][/B] and [B]p[i][/B] are characters of a string.
strcmp
expects a string and not a char
Re: strcmp not comparing strings
Programming
Software Development
16 Years Ago
by Salem
Because
strcmp
() is C. You're already half-way there with line 9, so just carry on using == to compare two std::string variables.
Strcmp function error
Programming
Software Development
14 Years Ago
by viji.cs
Hai everyone, I have one doubt... Can u please clarify this... If i put char a[10]="hai-hello" [I][CODE]if(
strcmp
(a[4],'-')==0)[/CODE][/I] then it will displays an error [B][I]
strcmp
' : cannot convert parameter 1 from 'char' to 'const char *'[/I][/B] Wat is the reason for this? Can anybody tell me
Re: Strcmp function error
Programming
Software Development
14 Years Ago
by Dazaa
the function is
strcmp
. you are comparing a character and not a string. You … a[3] not position a[4]. If you are using
strcmp
you can compare strings (notice double quotes).
Re: `strcmp' makes pointer from integer without a cast
Programming
Software Development
14 Years Ago
by gerard4143
Shouldn't this line be if((
strcmp
(first, workers[L].first) == 0) && (
strcmp
(last, workers[L].last) == 0)) calling
strcmp
twice. Also your error...first and last are characters not c-strings.
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC