Monday, October 13, 2014

C++ Tutorial for Beginners 42 -Create a Text File and Write in It













1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
///ofstream: Stream class to write on files
///ifstream: Stream class to read from files
///fstream: Stream class to both read and write from/to files.
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
  ofstream file_("mytext.txt");
 // file_.open("mytext.txt");
  if(file_.is_open()){
  file_ << "this is my first text file 1 \n";
  file_ << "this is my first text file 2 \n";
  file_ << "this is my first text file 3 \n";
  file_ << "this is my first text file 4 \n";
  file_.close();
  }

  std::cin.get();
  return 0;
}














Input/output with files - C++

Creating and writing to a file

Creating/Writing File (Win32)

Changable filename based on user input

Reading and Writing to a txt file.

fstream -- writing to files - C++ Forum

How to: Write a Text File

save - How to create text file in c++?

how to create a txt file in c++

c++ reading from txt file

Reading lines from txt file

Reading Line by Line from Text File into

Saving and Loading from a text file

Reading and Writing to a txt file.

php create text file and write to it

vb.net create text file and write to it

vbscript create text file and write to it

java create text file and write

Wednesday, October 8, 2014

Python Tutorial for Beginners 16 - Class Constructors (__init__) and Des...













1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
class Person:
    def __init__(self,id):
        self.id=id
        print("Our class is created")
    def __del__(self):
        print (self.id," Our class object is destroyed")
    def setFullName(self,firstName,lastName):
        self.firstName=firstName
        self.lastName=lastName
    def prinfFullName(self):
        print(self.firstName," ",self.lastName)

personName=Person(5)
personName.setFullName("programming","Knowledge")
personName.prinfFullName()
personName.__del__()      












---------------------------------------

python constructor overloading

python constructor super

python constructor return

python class init

python konstruktor überladen

python attribute

__init__

def __init__

Verwandte Suchanfragen zu python constructor destructor

python class constructor destructor

constructor and destructor in c++

python destructor method

base class constructor python

Saturday, September 20, 2014

C++ Tutorial for Beginners 37 - C++ Exception Handling (Try Throw Catch)















1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include<string>
#include <exception>
using namespace std;

int main()
{
 try{
   std::cout<<"Please enter age"<<std::endl;
   int age=0;
   std::cin>>age;
   if(age>100 || age<0)
   {
       throw 'a';
   }
 }
 catch(int e)
 {
     std::cout<<"Error No="<<e<<std::endl;
 }
  catch(char e)
 {
     std::cout<<"Error Char="<<e<<std::endl;
 }
  catch(...)
 {
     std::cout<<"Unknown Exception"<<std::endl;
 }
}












--------------------------------------------------------------------

c++ throw exception example

rethrow exception c++ example

Try and Catch

c++ custom exception example

c++ exception inheritance example

Saturday, September 13, 2014

C++ Tutorial for Beginners 35 - Introduction to Polymorphism in C++




















1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include<string>
using namespace std;
class shape
{
   public:
    void setValues(int a ,int b){
     width=a;
     height=b;
    }
    protected:
    int height ;
    int width;
};
class rectangle : public shape
{
   public:
       int area(){
         return (height * width);
       }
};
class triangle : public shape
{
   public:
       int area(){
         return (height * width/2);
       }
};

int main()
{
    rectangle rec;
    triangle tri;
    shape *poly1=&rec;
    shape *poly2=&tri;
    poly1->setValues(10,20);
    poly2->setValues(10,20);

    std::cout<<rec.area()<<std::endl;
    std::cout<<tri.area()<<std::endl;
}












-------------------------------------------------------

Verwandte Suchanfragen zu polymorphism c++

c++ polymorphismus

polymorphismus c++ beispiel

c++ virtual

c++ virtual function

polymorph c++

c++ pure virtual

c++ tutorial virtual

c++ virtual function 0

C++ Tutorial for Beginners 35 - Introduction to Polymorphism in C++




















1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include<string>
using namespace std;
class shape
{
   public:
    void setValues(int a ,int b){
     width=a;
     height=b;
    }
    protected:
    int height ;
    int width;
};
class rectangle : public shape
{
   public:
       int area(){
         return (height * width);
       }
};
class triangle : public shape
{
   public:
       int area(){
         return (height * width/2);
       }
};

int main()
{
    rectangle rec;
    triangle tri;
    shape *poly1=&rec;
    shape *poly2=&tri;
    poly1->setValues(10,20);
    poly2->setValues(10,20);

    std::cout<<rec.area()<<std::endl;
    std::cout<<tri.area()<<std::endl;
}












-------------------------------------------------------

Verwandte Suchanfragen zu polymorphism c++

c++ polymorphismus

polymorphismus c++ beispiel

c++ virtual

c++ virtual function

polymorph c++

c++ pure virtual

c++ tutorial virtual

c++ virtual function 0

Tuesday, August 26, 2014

C++ Tutorial for Beginners 33 - C++ Multiple Inheritance







1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include<string>
using namespace std;
///polygon // rectangle square triangle "is a " Animal dog cat
class shape
{
   public:
    void setValues(int a ,int b){
     width=a;
     height=b;
    }
    protected:
    int height ;
    int width;
};
class description
{
public:
   void print(string description_)
   {
     std::cout<<"We are using "<<description_<<" Class"<<std::endl;
   }
};
class rectangle : public shape ,public description
{
   public:
       int area(){
         return (height * width);
       }
};

int main()
{
   rectangle rec;
   rec.setValues(15,10);
   std::cout<<"area Rectangle= "<<rec.area()<<std::endl;

   rec.print("Rectangle");
}


















-------------------------------------------------------------

c++ multiple inheritance same function name

c++ virtual inheritance

c++ multiple inheritance same base class

c++ multiple inheritance syntax

c++ multiple inheritance diamond

c++ inheritance multiple files

c++ multiple inheritance casting

c++ multiple inheritance destructor

Saturday, July 26, 2014

C++ Tutorial for Beginners 31 - Operator Overloading in C++









1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include<string>
using namespace std;
class Vector {
  public:
    int x,y;
    Vector () {};
    Vector (int a,int b)
    {
        x=a;
        y=b;
    }
    Vector operator+(const Vector&);
};
Vector Vector::operator+(const Vector& parameter){
     Vector temp;
     temp.x=x+ parameter.x;
     temp.y=y+ parameter.y;
     return temp;
}
int main()
{
    Vector vec1(4,2);
    Vector vec2(2,2);
    Vector result;
    result=vec1+vec2;

    cout<<"the result is ("<<result.x<<","<<result.y<<")"<<endl;
    int x=2,y=3;
    int z=x+y;
    return 0;
}




















-------------------------------------------------------------------

Verwandte Suchanfragen zu operator overloading in c++

overloading ostream operator c++

c++ cast operator overloading

overloading assignment operator c++

overloading increment operator c++

c++ operator overloading wiki

c++ virtual operator overloading

c++ operator overloading example

C++ Operator Overloading Guidelines

C++ Overloading (Operator and Function)

C++ Operator Overloading

C++ Overloading and Operator Overloading

Searches related to c++ tutorials



c++ tutorials pdf



c++ examples



c++ video tutorials



dev c++ tutorials



visual c++ tutorials for beginners



advanced c++ tutorials



visual c++ tutorials

c++ tutorials youtube

C++ Programming/Operators/Operator Overloading

c++ operator+=

Saturday, July 12, 2014

C# MS Access Database Tutorial 1 # Getting Started and Access database C...









1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace AccessLoginApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                OleDbConnection connection = new OleDbConnection();
                connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\dwishika\Documents\Access Database\EmployeeInfo.accdb;
Persist Security Info=False;";
                connection.Open();
                checkConnection.Text = "Connection Successful";
                connection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error  "+ ex);
            }
        }
    }
}












_____________________________________________

C# Windows Form Application MS Access Connection

c# - How can I connect to MS Accessfrom windows forms?

Using Visual C# Windows Forms with MS Access

C# Programming for beginners: How to connect MS

Verwandte Suchanfragen zu C# MS Access Database Tutorial

ms access database tutorial pdf

microsoft access database tutorial

c# ms access database connection

c# ms access database example

how to connect ms access database in c#

AccessDatabase

Windows Form Application using MS AccessServer

Connect MS Accessfrom C# Windows Forms

MS Accessproblem to connect with windows form c#

C# Windows Form Application MS AccessConnection

MS Access And Visual C# 2010 Windows Form Application

MS Access:: Connecting to MS Accesswith a Windows Form application

C# Form textbox string into SQL Database

visual c# CLR windows form application and mysql

assembly reference not working in C# script

Trying to connect to MySQL from C# application

mysql and C# window form application

How to connect MS Accessusing C#?‎

Tuesday, July 8, 2014

C# Tutorial for Beginners 22 - Properties in C# (How to Define Properti...









1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
namespace MyProject.Examples
{
    public class Book
    {
        private int _id;
        private string _bookName;
        private int _noOfPAges=250;
        private string _auther;

  
        public string Auther{get; set;}
            

        public int Id
        {
            set
            {
                if (value < 0)
                    throw new Exception("Id not valid");
                this._id = value;
            }
            get {
                return this._id;
            }
        }
  


        public string BookName
        {
            set
            {
                if (string.IsNullOrEmpty(value))
                    throw new Exception("Book Name not valid or null");
                this._bookName = value;
            }
            get {
                return this._bookName;
            }
        }


        public int NoOfPAge
        {
            get
            {
                return this._noOfPAges;
            }
        }
    }
 

    class ExampleOne
    {
        public static void Main()
        {
         
            Book B1 =new Book();
            B1.Id=10;
            B1.BookName = "The C# Book";
            B1.Auther = "ProgrammingKnowldge";
            Console.WriteLine("The Book Id is {0}", B1.Id);
            Console.WriteLine("The Book Name is {0}", B1.BookName);
            Console.WriteLine("The Book Page is {0}", B1.NoOfPAge);
            Console.WriteLine("The Book Auther is {0}", B1.Auther);
            Console.ReadKey();
        }
    }
}














---------------------------------------------------------------------

earches related to properties c#

extension properties c#

use properties c#

writing properties in c#

override properties c#

private properties c#

class properties c#

properties.settings c#

constructor c#

Searches related to property c#

automatic property c#

virtual property c#

nonserialized property c#

property c# interface

property c# default value

override property c#

private set property c#

private property c#

Using Properties (C# Programming Guide)

Monday, July 7, 2014

C# Tutorial for Beginners 20 - Difference between Method Overriding and ...









1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
namespace MyProject.Examples
{
    public class Drawing
    {
        public virtual void Draw()
        {
            Console.WriteLine("This is just a generic drawing class");
        }
    }
    public class line : Drawing
    {
        public override void Draw()
        {
            Console.WriteLine("This is a Line");
        }

       /* public new void Draw()
        {
            Console.WriteLine("This is a Line");
        }*/
    }

    class ExampleOne
    {
        public static void Main()
        {
            Drawing obj = new line();

            Console.ReadKey();
        }
    }
}














-----------------------------------------------------------

Searches related to difference between method hiding and method overriding C#

difference between method overriding and method hiding in java

difference between method overloading and method overriding in c# net

difference between method overloading and method overriding in c#

method overriding vs method hiding in c#
IT Certification Category (English)640x480

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


Top Online Courses From ProgrammingKnowledge

Python Course http://bit.ly/2vsuMaS
Java Coursehttp://bit.ly/2GEfQMf
Bash Coursehttp://bit.ly/2DBVF0C
Linux Coursehttp://bit.ly/2IXuil0
C Course http://bit.ly/2GQCiD1
C++ Coursehttp://bit.ly/2V4oEVJ
PHP Coursehttp://bit.ly/2XP71WH
Android Coursehttp://bit.ly/2UHih5H
C# Coursehttp://bit.ly/2Vr7HEl
JavaFx Coursehttp://bit.ly/2XMvZWA
NodeJs Coursehttp://bit.ly/2GPg7gA
Jenkins Course http://bit.ly/2Wd4l4W
Scala Coursehttp://bit.ly/2PysyA4
Bootstrap Coursehttp://bit.ly/2DFQ2yC
MongoDB Coursehttp://bit.ly/2LaCJfP
QT C++ GUI Coursehttp://bit.ly/2vwqHSZ