c++ tutuorials

0 Arif Omanović · October 26, 2015
As I can see, there is no any video tutorial about the structures in c++ section. Where I can find tutorials about structures???

Post a Reply

Replies

Oldest  Newest  Rating
0 Scott Walker · October 26, 2015
Try Udemy, there is a good one on there.

https://www.udemy.com/free-learn-c-tutorial-beginners/learn/ 
0 John Wolf · October 30, 2015
Using Code::Block
Turtorials: C++ #43,#44,etc. basically all the tutorials on creating a Class

Matching your code exactly, I get no red box for an error, but when run I get undefined errors for all the parts of the class, like:

undefined reference to 'Sally::Sally();
undefined reference to 'Sally::~Sally();
undefined reference to 'Sally::printCrap();

basically all the methods in the class... so what gives?

Here's Main: ************************

#include <iostream>
#include "Sally.h"
using namespace std;

int main()
{
    Sally sallyObj;
    Sally *ptr = &sallyObj;

    sallyObj.printCrap(); // use . with objects
    ptr->printCrap(); // use -> with pointers

}

Here's Sally.h: **************

#ifndef SALLY_H
#define SALLY_H


class Sally
{
    public:
        Sally();
        ~Sally();
        void printCrap();
    protected:
    private:
};

#endif // SALLY_H

Here's Sally.cpp: ***********

#include "Sally.h"
#include <iostream>
using namespace std;

Sally::Sally()
{
    cout<<"I am a constructor"<<endl;
}

Sally::~Sally(){
    cout<<"I am a destructor"<<endl;
}

void Sally::printCrap(){
    cout<<"Ouch!"<<endl;
}
  • 1

C++

107,241 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator