Skip to content
Snippets Groups Projects
Commit f5a43322 authored by PasJad's avatar PasJad
Browse files

ex2: peu fonctionnel..

parent e84a490e
No related branches found
No related tags found
No related merge requests found
ex2/ex2 0 → 100755
File added
......@@ -8,15 +8,37 @@
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include <string.h>
int main(int argc, char **argv)
int main()
{
int arr_int[6];
for (int i = 1; i < argc; i++)
char* chaine1 = (char*)malloc(sizeof(char) * 100);
char* chaine2 = (char*)malloc(sizeof(char) * 100);
printf("chaine 1 :");
if (scanf("%s", chaine1) != 1)
{
arr_int[i-1] = atoi(argv[i]);
return EXIT_FAILURE;
}
printf("\nchaine 2:");
if (scanf("%s", chaine2) != 1)
{
return EXIT_FAILURE;
}
char* chaine3 = (char*)malloc(200);
for (size_t i = 0; i < strlen(chaine1); i++)
{
chaine3[i] = chaine1[i];
chaine3[i+1] = chaine2[i];
printf("chaine 3 = %c", chaine3[i]);
}
free(chaine3);
return 0;
}
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment