How to click one time mouse, then print "1"in the screen

if I want to when I click one time mouse, then print “1” on my screen, when I click one more time, the print “2”.

Looking forward your resolution!
Thanks very much!

Try something like this. Start from the empty example and modify ofApp.h and ofApp.cpp as shown.

ofApp.h:

#pragma once

#include "ofMain.h"

class ofApp : public ofBaseApp{
	public:
		void setup();
		void update();
		void draw();
		
		void mousePressed(int x, int y, int button);
    
    int clickCount;
};

and ofApp.cpp:

#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup()
{
    clickCount = 0;
}

//--------------------------------------------------------------
void ofApp::update()
{
}

//--------------------------------------------------------------
void ofApp::draw()
{
    ofSetColor(0);
    ofDrawBitmapString(ofToString(clickCount), 100, 100);
}

//--------------------------------------------------------------
void ofApp::mousePressed(int x, int y, int button)
{
    clickCount++;
}

ciao
Davide