I'm trying to use a system call to print out my IP address, instead of calling a batch script. My 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 I get this error "FINDSTR: Cannot open Address'". What am I doing wrong?