Results 1 to 4 of 4

Thread: M .

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Hard Core Gaming HardDrive's Avatar
    Join Date: Jun:2006
    Location:
    Posts: 754

    M .

    . . ... . , ,
    26 declaration of `Pol1::Pol1(int, int, int, int, int)' outside of class is not definition
    :
    #include<iostream>
    #include<cmath>

    using namespace std;

    class Pol1{
    private:
    int A;
    int B;
    int G;
    int C;
    int x;
    public:
    Pol1(int a2=0, int b2=0, int g2=0, int c2=0, int x2=0);
    void set_pol(int a2, int b2, int g2, int c2, int x2);
    void set_A (int a2);
    void set_B (int b2);
    void set_G (int g2);
    void set_C (int c2);
    void set_x (int x2);
    //double get_pol()const;
    double zzz()const;
    };

    Pol1::Pol1(int a2, int b2, int g2, int c2, int x2);
    { set_pol(a2, b2, g2, c2, x2); }

    void Pol1::set_pol(int a2, int b2, int g2, int c2, int x2);
    { void set_A (a2);
    void set_B (b2);
    void set_G (g2);
    void set_C (c2);
    void set_x (x2); }

    void Pol1::set_A(int a2);
    { A=a2; }

    void Pol1::set_B(int b2);
    { B=b2; }

    void Pol1::set_G(int g2);
    { G=g2; }

    void Pol1::set_C(int c2);
    { C=c2; }

    void Pol1::set_x(int x2);
    { x=x2; }

    double Pol1::zzz()const
    { return (Ax*Ax*Ax)+(Bx*Bx)+Gx+C; }


    int main()
    {
    Pol1 p;
    int a;
    int b;
    int g;
    int c;
    int x;

    cout<<"programata iz4islqva polinom ot vida Ax*Ax*Ax+Bx*Bx+Gx+C"<<endl;

    cout<<"vavedete A "; cin>>a; p.set_A(a);

    cout<<"vavedete B "; cin>>b; p.set_B(b);

    cout<<"vavedete G "; cin>>g; p.set_G(g);

    cout<<"vavedete C "; cin>>c; p.set_C(c);

    cout<<"vavedete x "; cin>>x; p.set_x(x);

    cout<<"sumata na polinoma e : "<<p.zzz(a,b,g,c,x);

    system("pause");
    return 0;
    }
    , , , ?

    edit: , . , Code::Blocks .
    , , .
    Last edited by HardDrive; 17th December 2009 at 19:21.
    Config: Ryzen 3700x / Gigabyte x570 Gaming X / RX480 Strix 1400@2250 / 2x8gb Corsair Vengeance / Seagate Barracuda 1Tb + 256gb OCZ Trion / SuperFlower Leadex II Gold 750w / BeQuiet B801 / LG 23MA53 + Philips 170c / Logitech G502 / CM QuickFire TK

    Acer Predator G9-593 I7 7700HQ + GTX1070

  2. #2
    Registered User FuLLmaXx's Avatar
    Join Date: Jan:2007
    Location: UK
    Posts: 540
    Quote Originally Posted by HardDrive View Post
    . . ... . , ,


    :


    , , , ?
    , main-, . , ( Code::Blocks)

    Build Messages:
    D:\Documents\informatika\test.cpp|25|err or: declaration of `Pol1::Pol1(int, int, int, int, int)' outside of class is not definition|
    D:\Documents\informatika\test.cpp|26|err or: expected unqualified-id before '{' token|
    D:\Documents\informatika\test.cpp|28|err or: declaration of `void Pol1::set_pol(int, int, int, int, int)' outside of class is not definition|
    D:\Documents\informatika\test.cpp|29|err or: expected unqualified-id before '{' token|
    D:\Documents\informatika\test.cpp|35|err or: declaration of `void Pol1::set_A(int)' outside of class is not definition|
    D:\Documents\informatika\test.cpp|36|err or: expected unqualified-id before '{' token|
    D:\Documents\informatika\test.cpp|38|err or: declaration of `void Pol1::set_B(int)' outside of class is not definition|
    D:\Documents\informatika\test.cpp|39|err or: expected unqualified-id before '{' token|
    D:\Documents\informatika\test.cpp|41|err or: declaration of `void Pol1::set_G(int)' outside of class is not definition|
    D:\Documents\informatika\test.cpp|42|err or: expected unqualified-id before '{' token|
    D:\Documents\informatika\test.cpp|44|err or: declaration of `void Pol1::set_C(int)' outside of class is not definition|
    D:\Documents\informatika\test.cpp|45|err or: expected unqualified-id before '{' token|
    D:\Documents\informatika\test.cpp|47|err or: declaration of `void Pol1::set_x(int)' outside of class is not definition|
    D:\Documents\informatika\test.cpp|48|err or: expected unqualified-id before '{' token|
    D:\Documents\informatika\test.cpp||In member function `double Pol1::zzz() const':|
    D:\Documents\informatika\test.cpp|51|err or: `Ax' was not declared in this scope|
    D:\Documents\informatika\test.cpp|51|err or: `Bx' was not declared in this scope|
    D:\Documents\informatika\test.cpp|51|err or: `Gx' was not declared in this scope|
    D:\Documents\informatika\test.cpp||In function `int main()':|
    D:\Documents\informatika\test.cpp|75|err or: no matching function for call to `Pol1::zzz(int&, int&, int&, int&, int&)'|
    D:\Documents\informatika\test.cpp|51|not e: candidates are: double Pol1::zzz() const|
    ||=== Build finished: 18 errors, 0 warnings ===|
    /Hidden: errors

  3. #3
    Registered User
    Join Date: Feb:2006
    Location: Plovdiv
    Posts: 392
    .. , . -
    Code:
    #include<iostream>
    
    using namespace std;
    
    class Poli
    {
    public :
    	int A;
    	int B;
    	int G;
    	int C;
    
    public:
    	Poli(int a=0, int b=0, int g=0, int c=0):A(a), B(b), G(g), C(c){};
    	double zzz(int x)const { return A*(x*x*x)+ B * (x*x)+ G*x+C; }
    };
    
    int 
    main()
    {
    	Poli p;
    	int x;
    
    	cout<<"programata iz4islqva polinom ot vida Ax*Ax*Ax+Bx*Bx+Gx+C"<<endl;
    
    	cout<<"vavedete A "; cin>>p.A;
    	cout<<"vavedete B "; cin>>p.B;
    	cout<<"vavedete G "; cin>>p.G;
    	cout<<"vavedete C "; cin>>p.C;
    	cout<<"vavedete x "; cin>>x;
    
    	cout<<"sumata na polinoma e : "<<p.zzz(x);
    
    	system("pause");
    	return 0;
    }
    ..
    ; , void-a zzz .

  4. #4
    Hard Core Gaming HardDrive's Avatar
    Join Date: Jun:2006
    Location:
    Posts: 754
    Me ,
    Config: Ryzen 3700x / Gigabyte x570 Gaming X / RX480 Strix 1400@2250 / 2x8gb Corsair Vengeance / Seagate Barracuda 1Tb + 256gb OCZ Trion / SuperFlower Leadex II Gold 750w / BeQuiet B801 / LG 23MA53 + Philips 170c / Logitech G502 / CM QuickFire TK

    Acer Predator G9-593 I7 7700HQ + GTX1070

Posting Permissions

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

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |