Computer Science, asked by manitisawant, 7 months ago

A class Cricket contains a function void print(). Write a va
statement to create object and invoke the function​

Answers

Answered by Kaushikkalesh
6

#include <iostream>

using namespace std;

class Cricket {

public:

void print() {

//code

}

}

int main() {

//creating object 'obj' and invoking the print() function

Cricket obj;

obj.print();

}

Answered by nimishthegreat2007
4

Answer:

Object creation: - Cricket sc = new Cricket();

invoke the function​: - sc.print();

Mark it the brainlest!!!

Similar questions