Home C C++ Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test

Home » Forum » x-Forum » Question

System command and variable-CppBuzz-Forum


I am new here. I have problem with very easy(14 lines) console program. It run console and u need to enter ip address, after this it will send command to printer.

i tried everything 


int main() {
 char naslov[16]="";
 printf("Za vnovicni zagon vnesite IP naslov tiskalnika in pritisnite enter:\r\n");

 scanf("%s", &naslov);

 system("curl -k -X PUT https://"%s"/ProductActions/PowerCycle -O '/tmp/pwrc' 2>&1", naslov);

 printf("Tiskalnik z IP naslovom: "%s", se je ponovno zagnal\r\n",naslov);
 return 0;


Thanks for replay!

Posted by kotjan 2021-01-06 01:30:16

No Ans Posted

Please login to comment

Log In

Ask New Question