Ecrire trois exemplaires d’un programme en C permettant de lancer la commande passée en argument en vous servant des trois fonctions prévues pour ce type d’opération.
Voici un exemple d’exécution possible en supposant que votre exécutable a pour nom « commande » :
kassouhuin@jik:~/Desktop/codes$ ./commande ls -l
total 48
-rw------- 1 kassouhuin kassouhuin 798 Apr 12 09:07 affichage_asynchrone.c
-rw------- 1 kassouhuin kassouhuin 529 Apr 12 22:12 affichage_simple.c
-rwxr-xr-x 1 kassouhuin kassouhuin 5098 Apr 12 09:11 compte_signal
-rw------- 1 kassouhuin kassouhuin 681 Apr 12 09:11 compte_signal.c
...When the title is in English, but the post is in what I believe is French...
What I am getting is that you're either coding in C and have a lot of issues, or the compiler has some problems with your object types or something, that are predefined in its C files.
Write three copies of a C program to launch the order placed in argument by using the three functions for this type of operation.
Here is an implementation example, possible assuming your executable is called "control":
kassouhuin jik @: ~ / Desktop / codes ./commande $ ls -l
total 48
-rw ------- 1 kassouhuin kassouhuin 798 Apr 12 9:07 affichage_asynchrone.c
-rw ------- 1 kassouhuin kassouhuin 529 Apr 12 10:12 p.m. affichage_simple.c
-rwxr-xr-x 1 kassouhuin kassouhuin Apr 12 5098 9:11 compte_signal
-rw ------- 1 kassouhuin kassouhuin 681 Apr 12 9:11 compte_signal.c
Uh....ok I think you need to create functions that have parameters if I'm understanding the wording? Btw when you said translate, I didn't think you'd use Google Translate bruh.
If it is functions with parameters uhm..either you're wanting to pass in by value or by reference. I think.
// Example program
#include <iostream>
#include <string>
usingnamespace std;
int passValue( int valParam );
int passRef( int &refParam );
int main()
{
int a, b;
cout << "Enter integer a: ";
cin >> a;
cout << "And integer b: ";
cin >> b;
cout << "Original values of a is: " << a << endl;
passValue( a );
cout << "New value of a is: " << a << endl;
cout << "Original value of b is: " << b << endl;
passRef( b );
cout << "New value of b is: " << b << endl;
return 0;
}
int passValue( int valParam )
{
return valParam += 5;
}
int passRef( int &refParam )
{
return refParam += 3;
}
@TheIdeasMan: oh ok thanks for the that. I knew something looked weird because I usually see #include<filename.h> instead of in c++ just the name of the library. But I didn't bother looking it up because I was tired, and the theory still applied, even if the syntax was wrong.
@OP: Here's what's up with the two functions I wrote, one with value and one with reference. Value creates a copy of the original variable, reference changes the original.