delete file in another folder

This is a discussion on delete file in another folder within the C Programming forums, part of the General Programming Boards category; Hi guys,im new here.This might have been posted somewhere but I cant find anything similiar. I want to write some ...

  1. #1
    Registered User
    Join Date
    Jul 2009
    Location
    New Zealand
    Posts
    1

    delete file in another folder

    Hi guys,im new here.This might have been posted somewhere but I cant find anything similiar.
    I want to write some code to delete or rename a file in another folder.Ive got some coding here:

    Code:
     int main() {
    remove("C:\Users\FW Esterhuysen\Esk 1.jpg");
    }
    but get this error message:
    >"C:\Program Files\gcc\bin/g++" -Os -mconsole -g d.c -o d.exe
    d.c:4:9: incomplete universal character name \U
    d.c:4:9: warning: unknown escape sequence '\F'
    >Exit code: 1

    Can some help me with this?Is there some pointer to use or some .h files that needs to be included?I get the same with renaming a file in another folder.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    The problem is that in C the backslash in string literals signifies the start of an escape sequence. If you want to have an actual backslash in the string you will need follow it by another, eg:

    Code:
    remove("C:\\Users\\FW Esterhuysen\\Esk 1.jpg");
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File Writing Problem
    By polskash in forum C Programming
    Replies: 3
    Last Post: 02-13-2009, 09:47 AM
  2. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  3. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 04:02 AM
  4. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21