Cześć,
Ma ktoś pomysł, jak mogę uzyskać kod, który zwraca program wywoływany przez cmd (za pomocą funkcji system()
)?
Z góry dzięki za pomoc.
Cześć,
Ma ktoś pomysł, jak mogę uzyskać kod, który zwraca program wywoływany przez cmd (za pomocą funkcji system()
)?
Z góry dzięki za pomoc.
Nie da się zwrócić programu.
Możesz utworzyć strumień/potok/fifo za pomocą którego będziesz komunikował się z programem.
Tu przykład http://stackoverflow.com/questions/646241/c-run-a-system-command-and-get-output
int system (const char* command);
Generalnie ta funkcja zwraca Ci inta, który powinien być tym kodem.
Return Value
If command is a null pointer, the function returns a non-zero value in case a command processor is available and a zero value if it is not.If command is not a null pointer, the value returned depends on the system and library implementations, but it is generally expected to be the status code returned by the called command, if supported.
Tak, to jest to. Dzięki. :)