C++ - System findstr "FINDSTR Cannot open..." -


i'm trying use system call print out ip address, instead of calling batch script. current code is:

#include <iostream> #include <string>  void main(){ system("@echo off"); system("ipconfig | findstr /r /c:'ipv4 address'"); system("pause"); return; } 

however when ran error "findstr: cannot open address'". doing wrong?


Comments