get directory of a file linux

C++
import os

#Get Current working Directory
currentDirectory = os.getcwd()

#Change the Current working Directory
os.chdir('/home/varun')
Signed-off-by: Dwaipayan Ray <[email protected]>Fucking asshole Greppere.. SEX, Porn, Xvideo, Pornhub
Source

Also in C++: