Thread: error with new instants of classes

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    32

    error with new instants of classes

    hi, I keep getting this error when I was compiling with dev c++
    13 C:\Dev-Cpp\Projects\Crypter\main.cpp expected primary-expression before ';' token

    Code:
    case IDC_BTN_SUBMIT:
    {
         REPLACE or;
         Sub(or);
    }
    break;
    
    and the header file
    
    class REPLACE {
         char* in;
         char* plain;
         char* encrypt;
         int p, e;
         int len;
    };
    
    void Sub(REPLACE);

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    The word "or" is a reserved word in C++, so perhaps that would cause a problem. Try renaming the variable...

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    32
    Thanks. That solved the problem. Must be more careful about names...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multiple Inheritance - Size of Classes?
    By Zeusbwr in forum C++ Programming
    Replies: 10
    Last Post: 11-26-2004, 09:04 AM
  2. im extreamly new help
    By rigo305 in forum C++ Programming
    Replies: 27
    Last Post: 04-23-2004, 11:22 PM
  3. Exporting VC++ classes for use with VB
    By Helix in forum Windows Programming
    Replies: 2
    Last Post: 12-29-2003, 05:38 PM
  4. Prime Number Generator... Help !?!!
    By Halo in forum C++ Programming
    Replies: 9
    Last Post: 10-20-2003, 07:26 PM
  5. include question
    By Wanted420 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2003, 03:49 AM