title: error: expected primary-expression before ‘)’ token
body: <p>I have tried many times to solve this problem but i got nothing.</p>
  
  <p>The main purpose of this code is saving pair keys (Public and Private) in nested class <code>NslObject::KeyK</code> or <code>NewKeyPair1</code>.</p>
  
  <p><strong>.cpp file</strong></p>
  
  <pre><code>        unsigned long int keyLength = 10;
          //KeyPair ADD(RSA::GenerateKeyPair(keyLength));
          NslObject::KeyK(RSA::GenerateKeyPair(keyLength));
          typedef NslObject::KeyK NewKeyPair1; 
          NewKeyPair1(RSA::GenerateKeyPair(keyLength));
  
          //NslObject::
          Key OtmanK(NslObject::Get_PublicKey(NewKeyPair1));
  </code></pre>
  
  <p><strong>.h file:</strong></p>
  
  <pre><code> #ifndef    __NCTUNS_nslobject_h__
   #define __NCTUNS_nslobject_h__
  
   #include &lt;stdio.h&gt;
   #include &lt;event.h&gt;
  
   //---------------------------------------------------
   #include &lt;cstdlib&gt;      //srand()
   #include &lt;iostream&gt;     //cout
   #include &lt;ctime&gt;        //time()
   #include &lt;cstring&gt;      //strcmp()
   //#include "test.h"       //testing functions
   #include "RSA.h"        //GenerateKeyPair()
   #include "PrimeGenerator.h"     //Generate()
   //#include &lt;stdio.h&gt;
   #include &lt;stdlib.h&gt;
   #include &lt;sstream&gt; 
   #include &lt;string&gt;
  
  
   //---------------------------------------------------
  
   class MBinder;
  
    struct plist {
  u_int8_t        pid;
  struct plist            *next;
   };
  
    struct MBlist {
  u_int8_t    portnum;
  MBinder     *sendt;
  struct MBlist   *next;
   };
   /*=========================================================================
   Define Macros
   =========================================================================*/
   #define DISABLED       0x00
   #define ENABLED            0x01
  
  
   /*=========================================================================
   Define Class ProtoType
   =========================================================================*/
  
   class NslObject {
  
   private: 
  
  char        *name_;     /* Instance name */
  const u_int32_t nodeID_;    /* Node Id */
  const u_int32_t nodeType_;  /* Node type, eg: SWITCH, HOST.. */
  u_int32_t   portid_;    /* port Id */
  struct plist    *MPlist_;
     // static  KeyPair  NewKeyPair;
  
  
    public :
  /* add for new structure engine*/
      u_int32_t       pdepth;
      struct MBlist   *BinderList;
      u_int8_t       PortNum;
  
  //------------------------------------------------
      class KeyK {
      private :
           KeyPair Kk; 
  
      public:
  
        KeyK( KeyPair D1): Kk(D1)
        {}
  
       const  Key &amp;GetPrivateKey() const
              {
                      return Kk.GetPrivateKey();
              }
  
       const  Key &amp;GetPublicKey() const
              {
                      return Kk.GetPublicKey();
              }
  
         //KeyK  NewKeyPair ;
  
  
       };
  
       Key Get_PrivateKey(KeyK &amp;K){
          return K.GetPrivateKey();
       }
        Key Get_PublicKey(KeyK &amp;K){
          return K.GetPublicKey();
       }
  
  
      //static KeyPair  *KeyPtr1 ;//= new KeyPair;
      //------------------------------------------------
  u_char          s_flowctl;      /* flow control for sending pkt */
  u_char          r_flowctl;      /* flow control for receiving pkt */
  
  MBinder     *recvtarget_;   /* to upper component */
  MBinder     *sendtarget_;   /* to lower component */
  
  
  NslObject(u_int32_t, u_int32_t, struct plist*, const char *);
  NslObject();
  virtual         ~NslObject();   
  virtual int     init();
  virtual int     recv(ePacket_ *); 
  virtual int     send(ePacket_ *); 
  virtual int     get(ePacket_ *, MBinder *);
  virtual int     put(ePacket_ *, MBinder *);
  virtual ePacket_    *put1(ePacket_ *, MBinder *);
  virtual int     command(int argc, const char *argv[]); 
  virtual int     Debugger();
  
  
  inline  void    set_port(u_int32_t portid) { 
          portid_ = portid; 
      };   
  inline u_int32_t get_port() const { 
          return(portid_); 
      }; 
  inline struct plist* get_portls() const {
          return(MPlist_);
      };
  inline const char * get_name() const {
          return(name_);
      }
  inline u_int32_t get_nid() const {
          return(nodeID_);
      }
  inline u_int32_t get_type() const {
          return(nodeType_);
      }
      //--------------------------------------------------------
  
  
  
  
  
    };
  </code></pre>
  
  <p>so, the problem in this line in cpp file :</p>
  
  <pre><code> Key OtmanK(NslObject::Get_PublicKey(NewKeyPair1));
  </code></pre>
  
  <p>when i tried to compile this project, i got this Error message:</p>
  
  <pre><code> object.cc:87: error: expected primary-expression before ‘)’ token
  </code></pre>
  
  <p>please, help me.</p>
  
  <p>when i tried to make a directed call for key class, the other problem was appeared such as :</p>
  
  <pre><code>        unsigned long int keyLength = 10;
          //KeyPair ADD(RSA::GenerateKeyPair(keyLength));
          NslObject::KeyK(RSA::GenerateKeyPair(keyLength));
          typedef NslObject::KeyK NewKeyPair1; 
          NewKeyPair1(RSA::GenerateKeyPair(keyLength));
  
          //NslObject::
          //Key OtmanK(NewKeyPair1.GetPublicKey());
          std::string message = "othman Alkilany";
          // NslObject::NewKeyPair.GetPrivateKey()
         std::string cypherText = RSA::Encrypt(  message, NewKeyPair1.GetPublicKey());
  </code></pre>
  
  <p>the Error Message is :</p>
  
  <pre><code>  error: expected primary-expression before ‘.’ token
  </code></pre>