Jump to content
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C++, première classe ...

Featured Replies

Salut INpact ;)

Je commence à faire du C++ mais j'ai un petit problème pour faire des classes ...

Par exemple, je crée 3 fichier : main.cpp, Point.cpp et Point.h. En voici leur contenu :

// main.cpp 
#include <iostream>
using namespace std;

#include "Point.h"

int main()
{
 Point a(1,2);
 
 system("pause");	
 return 0;
}

// Point.cpp
#include "Point.h"

class Point {
   private :
       int x; 
       int y;
       
   public :
       Point (int abs, int org) {
           x = abs; y = ord;
       }    
};

// Point.h
#ifndef POINT_H
#define POINT_H

Point (int, int);

#endif

Je voudrais créer l'objet a de type Point (Point a(1,2); ), mais ça ne fonctionne pas :(

Merci d'avance pour votre aide

:p

  • Author

Hmm ... Ok je crois que j'ai compris. Comme ça, ça fonctionne :

//main.cpp
#include <iostream>
using namespace std;

#include "Point.h"

int main ()
{
   Point a(1,2);
   system ("pause");
   return 0;
}    

//Point.cpp
#include "Point.h"

Point::Point (int abs, int ord) {
   x = abs; y =ord;
}

//Point.h
#ifndef POINT_H
#define POINT_H

class Point
{
   int x;
   int y;
   
   public:
       Point (int, int);
};

#endif

Mes jeux de mots à la c** ^^ :pleure:

Heuuuu tu devais avoir bcp transpirer et abuser de l'Amaréto là car...Enfin no commant :craint:

Archived

This topic is now archived and is closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.