Wox-xion Dev wiki

old:stmaurice:mathsap

Maths appliquées

Bienvenue dans la section du site.

Index

Exemple en c

Fichier : HelloWorld.c

#include <stdio.h>
 
char * m;
 
int main(int argc, char *argv[]){
        m = "Hello world all !\n";
        printf(m);
 
        m++;
        while(*m) {
                if(*m == '\n') break;
                printf(m);
                m++;
        }
 
        getchar();
        return 0;
        }

Résultat : http://projects.wox-xion.ch/intern/download/mathsap/HelloWorld_c.exe

Exemple en c++

Fichier : HelloWorld.cpp

#include <stdio.h>
#include<iostream>
 
using namespace std;
 
class HelloWorld{
    private:
        char * message;
 
    public:
        HelloWorld(){
                message = "Hello world to all!\n";
                }
 
        char * getMessage();
};
 
char * HelloWorld::getMessage(){
    return message;
    }
 
int main(int argc, char *argv[]){
        HelloWorld * hw = new HelloWorld();
        printf(hw->getMessage());
 
        char * m = hw->getMessage();
        m++;
        while(*m) {
                if(*m == '\n') break;
                cout << *m << endl;
                m++;
        }
 
        getchar();
        return 0;
        }

Résultat : http://projects.wox-xion.ch/intern/download/mathsap/HelloWorld.exe

old/stmaurice/mathsap.txt · Dernière modification: 2011/09/04 23:35 (modification externe)