Bonjour , je début en c++ et c'est la première fois que je crée une fonction et que je dois l'appeller mais ca ne foncctionne pas . Je ne comprend plus du tout comment faire , j ai tt essayé !!!
Ah ouib et si kelk un savait me dire comment concaténer deux élément de type char en un ca serait coool :p
// palindrome.cpp : Defines the entry point for the console application.
//
#include "stdafx.h";
#include <iostream.h>;
#include <string.h>;// Permet d'intégrer la fonction strlen
char palin[15];
int i,j,test,test2,nblettre;
int main(int argc, char* argv[])
{
void Palindromeverif();// Annonce la fontion
cout<< "**********************************************************"<<"\n";
cout<< "Veuillez rentrer une chaine de caractère sans espace svp ."<<"\n";
cout<< "**********************************************************"<<"\n";
cin>>palin;
nblettre=strlen(palin);// Retient le nombre de lettre que contient la chaine de caractère .
cout<<"**********************************************************"<<"\n";
cout<<"Palindrome dans "<< palin<<" ? "<<"\n";
cout<<"**********************************************************"<<"\n";
/////////////////////////
if (nblettre <= 2)//Vérifie si le nombre de lettre est inférieure à 1.
{
cout<<"Chaine trop courte pour être un palindrome"<<"\n";
}
else
Palindromeverif();// lance la fonction
return 0;
}
Palindromeverif();// fonction
{
char palindromeM[15],palindromeF[15],palindromeD[15];
j=1;
i=1;
test = 1;
test2 = 1;
return;
}
--------------------Configuration: palindrome - Win32 Debug--------------------
Compiling...
palindrome.cpp
c:\documents and settings\toni0\bureau\cpp\palindrome\palindrome\palindrome.cpp(4) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
c:\documents and settings\toni0\bureau\cpp\palindrome\palindrome\palindrome.cpp(5) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\Documents and Settings\Toni0\Bureau\Cpp\Palindrome\palindrome\palindrome.cpp(6) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
********************************************************************
C:\Documents and Settings\Toni0\Bureau\Cpp\Palindrome\palindrome\palindrome.cpp(36) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.
*********************************************************************
palindrome.obj - 1 error(s), 3 warning(s)