In Visual Studio 2017, in C ++ I made a program where I have the error E0427 qualifie

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Turbureanu
    New Member
    • Oct 2019
    • 1

    In Visual Studio 2017, in C ++ I made a program where I have the error E0427 qualifie

    Code:
    #include<iostream>
    using namespace std;
    int main()
    {
    	class ContBancar {
    	private:
    		char titular[100];
    		char codIBAN[25];
    		float sold;
    		float ContBancar;
    		
    	public:
    		void init(char _titular[], char _codIBAN[], float _sold);
    		void depune(float suma);
    		void retrage(float suma);
    		float interogareSold();
    		void afisare();
    		
    		void ContBancar::init(char _titular[], char _codIBAN[], float _sold)
    		{
    
    			strcpy(titular, _titular);
    			strcpy(codIBAN, _codIBAN);
    			sold = _sold;
    		}
    		void ContBancar::depune(float suma)
    		{
    			sold = sold + suma;
    		}
    		void ContBancar::retrage(float suma)
    		{
    			sold = sold - suma;
    		}
    		float ContBancar::interogareSold()
    		{
    			return sold;
    		}
    		void ContBancar::afisare()
    		{
    			printf("Titular:%s\n", titular);
    			printf("Cod IBAN:%s\n", codIBAN);
    			printf("Sold:%g\n", sold);
    		}
    	};
    system("pause");
    	return 0;
    }
    Last edited by gits; Oct 29 '19, 07:31 AM. Reason: added code tags
  • dev7060
    Recognized Expert Contributor
    • Mar 2017
    • 656

    #2
    Scope resolution operator is not used when a function is defined inside the class.

    Example:
    Code:
    class A {
      public:
      void fun(){
        ...
      }
      void fun2(){
        ...
      }
    };
    Also, remove the function declarations since those are not required.

    Comment

    Working...