How to access sd card from computer in marshmallow
I found a solution of this problem. Each time I connect my phone to my computer I have to go to Settings -> Developer options -> Select USB Configuration and select MTP(Media Transfer Protocol). Then I can access the SD card from my computer. It turns out that whenever its needed to connect the phone and the computer this procedure is to be followed.