CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2009
    Posts
    11

    Post term does not evaluate to a function taking 2 arguments

    Hi, this is the first c++ program I write on my own. It should be about the RSA algorithm for encrypting data.

    The source code is attached. It gives me this error when I try to compile:
    error C2064: term does not evaluate to a function taking 2 arguments

    The error started when I started to include the euclidic algorithm, nevertheless the euclidic algorithm alone works to compile (and also gives me the gct).

    I'm very new to programming (just started three days ago), so please don't blame me if the error is very stupid.

    source code attached

    every help will be appreciated

    thanks
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: term does not evaluate to a function taking 2 arguments

    Next time, please specify the line where the error occurs.

    I've noticed this:
    Code:
    cin >> q; cout;
    You don't output anything there...
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Feb 2009
    Posts
    11

    Re: term does not evaluate to a function taking 2 arguments

    Sorry the compiling error occur at line 62.
    @ cilu: the error is still there.
    Last edited by Max Pain; February 5th, 2009 at 03:10 PM.

  4. #4
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: term does not evaluate to a function taking 2 arguments

    It looks like you declared a local variable named ggt, and thus the name of the variable hides the name of the function. This is one reason why it is good to follow the "declare variables near first use" rule of thumb.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  5. #5
    Join Date
    Feb 2009
    Posts
    11

    Re: term does not evaluate to a function taking 2 arguments

    @ laserlight: can you please specify what I would have to change. I m sorry, but I m very new to programming.

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: term does not evaluate to a function taking 2 arguments

    In the first line of main, you declare a bunch of ints. One of them is called ggt, which is the same name as your function ggt. You need to change one of them.

    I'd get out of the habit of using single character and meaningless variable names ASAP.

  7. #7
    Join Date
    Feb 2009
    Posts
    11

    Re: term does not evaluate to a function taking 2 arguments

    Oh I get it. Thx laserlight. As mentioned above the error is probably a very stupid one.
    Its working now wooho

  8. #8
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: term does not evaluate to a function taking 2 arguments

    Quote Originally Posted by Max Pain View Post
    @ laserlight: can you please specify what I would have to change. I m sorry, but I m very new to programming.
    http://www.codeguru.com/forum/showthread.php?t=231039
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured