i have a program that will create a father process( called 1 ) then the program asks if u want to add processes suppose that we want to add a process (1.1 et 1.2 ) if we want to add a process how can i specifie if its 1.1.1 or 1.2.1 !!!!
Can you even compile it ???? I doubt it !!!!
Please post a compilable code and translate your identifiers and strings to English.
Next time use [code][/code] tags.
I'm pretty good with my french. Let's see:
Veuillez entrer un autre numero entre 1 et 5
I believe that's along the lines of: enter another number between 1 and 5
The first few cout lines are:
#1 Unknown
2 Add process(es)
3 Stop process(es)
4 Restore state of processes? (not quite sure)
5 Exit
choix = choice. fonctionnel = functional AFAIK.
And I did not use a translator program for that.
Anyway, I think that code might compile. Just that it's really hard to tell with no code tags or indentation.
And, @OP: I don't see any actual creating of processes here. Do you actually know how to create a process?
He is missing the closing parenthesis of the printf call*, and has one unnecessary closing bracket.
*(Why he uses cout and printf together for simple string output is another mystery)
I don't see any actual creating of processes here.
I've never used it but doesn't fork() do something like that?
no this programs doesnot compile : but i am gonna explain for u wut i tried to do :
first create a process (1) this process 1 ask the user ( ANYONE ) to choose an option from the menu :
- add a process
-stop a process
-show the status of a processus
-terminate every thing and stop the program
i have to create 5 generations of processes ( 1 , 1.1 - 1.2 , 1.1.1- 1.2.1 - 1.2.2 .... )
thats wut i am tryin to do with my beginners code so any suggestion ?
Create some strings to store the name of the processes. Each time you create a new process, create a new string to accompany it. Take the name of the parent and append whatever it is you want to end it with. (.1, .2, etc)
Or you could write a class to contain this information in a process tree package.
OK, that crap English is really getting to me. I've been told that I'm being a little harsh (and those of you who did, you are probably right), and I'm honestly trying to tone down, but do stick to proper grammar and spelling. And those exclamation marks are unnecessary. It's like typing in all caps. This isn't life and death, it's just programming.
Now then, here's what I was talking about. You start out with a process named 1. You create a string that represents that name. The string's contents are "1". (PID, or whatever you want to call it.)
When you create a child of that process, you take the string id of the parent (which currently equals 1) and then append a period, and the number of the child. So if you were creating child 2 of process 7, it would look like this: childPID = parentPID + "." + PIDnumber
Assuming all those variables are strings. (PIDnumber might be an integer and it would still work of course.)
Once you create that PID, you output it to a file. If you know how to handle files good. If not check the documentation in this website. The tutorial therein has an explanation for STL file manipulation.
Got all that?
Tummy I totally agree with you, I hate it when kids (or even adults) get on here speaking in l33t, or usin masiff abrev8ns!!1!
But I think there's a big difference between that and someone who doesn't speak English as their primary language. French Canadian, or French most speak(write) French better than English.
I'm pretty good with my french. Let's see:
If this was a French site, you would have butchered it majorly :)