Link to home
Start Free TrialLog in
Avatar of rixxagain
rixxagain

asked on

Its Me again. How can I branch to a function to compare strings?

I'll be broke before I understand this C++. Haha.

I want to branch to a function to compare strings, however;  the parameters confuse me , and I get errors like c2664 " Function cannot convert parameter number from type 1 to type 2".

Here's the relevant code: ( I think).
{
// other code

int curse(char, char);
...

     int ctr=0;
loop: ctr++;
            if (ctr>10)
                 goto dead;

            cout << "\n" << qstring;
            cin.get(what,256);
            char swore=curse(char w,char s);
       if (0==stricmp(what,testone))
          goto next;
       cin.ignore(256,'\n');
        goto loop;

// other code
Return 0
}


curse(char s1, char s2)
{
     strcpy(s2," why you");
     if (0==stricmp(s1,s2)
          cout << " why you too!!/n" << "Just answer the question\n";
     return 0;
}

Hope this is clear enough.  Any other questions- let me know.

Thx
Rick

ASKER CERTIFIED SOLUTION
Avatar of GGRUNDY
GGRUNDY

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Adam Leinss
It may help to post all of the code at a URL, then give us the complete error messages with line numbers. For example, like this: http://vhosts.stealth.kirenet.com/~aleinss/multithread.c
I have asked questions on here myself before and it helps lot.

Sounds like you are trying convert one incompatible variable type to another type.

In terms of your code...I have no clue what you are doing.  For starters, using goto is extremely bad programming taste [the assembly people can stay away from this question ;)], even if you are playing with C/C++. And then you have stuff like this:

char swore=curse(char w,char s);

when curse returns an int, not a char (although it probably will work, since char really is just an ASCII integer value internally).
Avatar of Mindphaser
Mindphaser

Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks,

** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
Dear rixxagain

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "GGRUNDY"

comment(s) as an answer.

If you think your question was not answered at all, you can explain here why you want to do this and post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: https://www.experts-exchange.com/commspt/


PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
Force accepted

** Mindphaser - Community Support Moderator **