A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Re: C++ program - Stikked
From Kramthi, 11 Years ago, written in C++.
This paste is a reply to C++ program from Kramthi - go back
Embed
Viewing differences between C++ program and Re: C++ program
#include <array>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

class Student
{
        std::string studentName, studentNo;
public:
        Student () {}
        Student (const std::string &sName, const std::string &sNo);
        void setName ( const std::string &sName);
        void setNumber (const std::string &sNumber);
        std::string getName () const;
        std::string getNumber () const;
        friend std::ostream  & operator << (std::ostream &outPut ,Student &student );
};

std::ostream& operator << ( std::ostream  &outPut , Student &student)
{
        outPut << student.getName () << " " << student.getNumber () << std::endl;
        return outPut;
}
Student::Student (const std::string &sName, const std::string &sNo)
{
        studentName = sName;
        studentNo = sNo;
}



void Student::setName( const std::string &sName)
{
        studentName = sName;
        return;
}

void Student::setNumber (const std::string &sNumber)
{
        studentNo = sNumber ;
        return;
}

std::string Student::getName () const
{
        return studentName ;
}

std::string Student::getNumber () const
{
        return studentNo;
}

int main ( )
{

    std::vector < Student > student_vector;
    std::string name , number;
    int i = 0 ;
    while (  i < 10 )
    {
        std::cout <<"Enter name of student :: " ;
        std::getline ( std::cin , name );
        std::cout << "Enter number :: " ;
        std::getline ( std::cin , number ) ;
        Student s ;
        s.setName( name ) ;
        s.setNumber ( number ) ;
        student_vector.push_back ( s ) ;
        i ++ ;
    }
    for ( int i = 0 ; i < student_vector.size() ; i ++  )
        std::cout << student_vector [ i ] << std::endl ;

    return 0;
}