Thread: Invalid storage class for a function.

  1. #1
    Registered User
    Join Date
    Oct 2013
    Posts
    34

    Invalid storage class for a function.

    My problem is probably a simple fix but I am having trouble figuring it out. I made a program and when I try to use the main driver to instantiate everything it says invalid storage class for a function. All of my code is in 4 separate files i'm just trying to get it to run now.

    Code:
    #include "stdafx.h"
    #include <iostream>
    #include <iomanip>
    #include <fstream>
    #include <string>
    #include <conio.h>
    #include "CashRegister.h"
    
    
    
    
    int _tmain(int argc, _TCHAR* argv[])
    {
        
        
        CashRegister register;
        register.run();
        _getch();
        
        
        return 0;
    }

  2. #2
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    The `register' lavel is a keyword.

    You can't use the label for a variable name.

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Invalid storage class for function
    By InicDominus in forum C Programming
    Replies: 9
    Last Post: 10-15-2012, 11:51 AM
  2. static storage class
    By roaan in forum C Programming
    Replies: 4
    Last Post: 09-08-2009, 04:57 PM
  3. storage class specifier
    By -EquinoX- in forum C Programming
    Replies: 5
    Last Post: 11-06-2008, 04:07 PM
  4. Dynamic storage class?
    By Xinok in forum C++ Programming
    Replies: 12
    Last Post: 12-20-2005, 01:14 PM
  5. Storage Class
    By Blanket in forum C++ Programming
    Replies: 5
    Last Post: 04-15-2003, 09:54 PM