IS there any possible way to change the ip address , subnetmask and gateway of my raspberry pi using my c++ program. Through a c++ program how can I cahnge the IP address of my pi. Any possible way to do it.

put on hold as off-topic by Milliways, Ingo, Aurora0001, Dmitry Grigoryev, Ghanima Feb 13 at 16:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – Ghanima
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Thank you so much for the reply. Can you pls elaborate and tell me how to do it or give me some links to any tutorial. Im very sorry if im sounding naive but i am very weak in c++. could you pls help me out. – roshini Jan 31 at 11:51
  • Yae but the problem is I cannot directly open /etc/dhcpcd and edit it I need to do it through a cpp program. any idea how I can do it. – roshini Jan 31 at 11:56
  • There is this system() call which allows you to run any command pretty much in the same way as in a terminal. – Dmitry Grigoryev Feb 13 at 14:47