Bonjour,

Je suis en train de réaliser un programme qui permet de faire
différentes action sur une image, les fonctions sont déjà testé et fonctionnelle.
Mais je ne sais pas pourquoi, lorsque je teste il ne rentre jamais dans le strcmp que je souhaite.

ex: je tape "-i"il m'affiche "need help ?",voire ça m'est déjà arriver qu'il fasse toutes les fonctions.

Je vous remercies d'avance !

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
 
//#include "Structure.h"
//#include "Prototype.h"
//#include "Function.h"
 
int main()
{
    char choix[6]="";
 
    for(;;)
    {
        printf("PANORAMA(7)\n\n");
        printf("NAME\n");
        printf("  panorama - automatically create panoramas \n\n");
        printf("SYNOPSIS\n");
        printf("  panorama [OPTION]...\n\n");
        printf("DESCRIPTION\n");
        printf("  Image manipulation helper to create panoram\n\n");
        printf("USAGE \n");
        printf("  Usage : panorama [OPTION...]\n\n");
        printf("  Help options\n");
        printf("   -?, --help      Shows this help message\n");
        printf("  General Options\n");
        printf("   -g              Convert the input file(s) to grayscale\n");
        printf("   -h              Extract the histogram from the input file(s)\n");
        printf("   -e              Erode the input file(s)\n");
        printf("   -d              Dilate the input file(s)\n");
        printf("   -b threshold    Render a black-white image using the giving threshold \n");
        printf("   -c file         Apply a convolution on the input file(s) using the \n given file as the convolution matrix\n");
        printf("   -p              Render the panorama from the input file(s)\n");
        printf(" Working on single file\n");
        printf("   -i file         Define the input file\n");
        printf("   -o file         Define the output file\n");
        printf(" Using multiple files\n");
        printf("   -li file1,file2,...,filen   Define a set of files as the input\n");
        printf("   -lo file1,file2,...,filen   Define a set of files as the output\n");
        printf("   -exit           Exit\n");
 
        scanf("%s",choix);
        printf("%s",choix);
 
        if(strcmp(choix,"-?"))
            printf("need help ?");
 
        else if(strcmp(choix,"--help"))
            printf("need mega help ?");
 
        else if(strcmp(choix,"-g"))
            printf("work in progress ...");
 
        else if(strcmp(choix,"-h"))
            printf("work in progress ...");
 
        else if(strcmp(choix,"-e"))
            printf("work in progress ...");
 
        else if(strcmp(choix,"-d"))
            printf("work in progress ...");
 
        else if(strcmp(choix,"-b"))
            printf("work in progress ...");
 
        else if(strcmp(choix,"-c"))
            printf("work in progress ...");
 
        else if(strcmp(choix,"-p"))
            printf("work in progress ...");
 
        else if(strcmp(choix,"-i"))
        {
            /*InpOutFile(&Im);
            cptChar(&Im);
            StockMemory(&Im);*/
        }
 
        else if(strcmp(choix,"-o"))
        {
            //CopyFile(&Im);
            printf("ok11");
        }
 
        else if(strcmp(choix,"-li"))
            printf("work in progress ...");
 
        else if(strcmp(choix,"-lo"))
            printf("work in progress ...");
 
        else if(strcmp(choix,"-exit"))
            exit (0);
 
    }
 
 
}