Thread: delete file in another folder

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

    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:

     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
    Waterloo, Texas
    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:

    remove("C:\\Users\\FW Esterhuysen\\Esk 1.jpg");
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
        return std::pow
            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, 10: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, 05:02 AM
  4. archive format
    By Nor in forum A Brief History of
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM

Tags for this Thread