Thread: Debug Mode

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    385

    Debug Mode

    When you are using ifstream, you are refering to a file like this "file1.txt" as in the code.
    This meens that you refer to a file that is within:
    C:\Documents and Settings\Coding\My Documents\Visual Studio 2008\Projects\Test

    This is a file that is in the debugfolder.
    How does this work. Later when a application is finished you perheps want this file under C:\FinishedProgram\files.

    What I meen is that within the application you are doing you have different folders with different files that you want to access through different folders like ex "c:\finishedprogram\files" or "c:\finishedprogram\files2"
    How does this work because in debugmode you are just within the folder "Debug" under projects.

    Code:
    ifstream File("file1.txt");
    Last edited by Coding; 02-14-2008 at 08:51 AM.

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    129
    Just make sure that file exists in the installation phase if your program does not create it.
    He who asks is a fool for five minutes, but he who does not ask remains a fool forever.

    The fool wonders, the wise man asks. - Benjamin Disraeli

    There are no foolish questions and no man becomes a fool until he has stopped asking questions. Charles Steinmetz

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    ifstream is native and not managed. Don't use it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    It is difficult to know in the beginning all syntax wich are native and managed but am learning.
    I do understand that you shouldn´t use native code within Form application.
    Important to understand though, will it work anyway If you use native code or is it more because that it is not ment to be used in Forms.

    Thanks
    Last edited by Coding; 02-14-2008 at 11:14 AM.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    It doesn't work right because you use it within managed environment.
    Use some sort of documents - it's not very hard at all to know what's managed and native.
    Everything in the std:: namespace is native. Everything typical C is native.
    Everything in the System and cli namespaces are managed.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    I will keep this in mind. That is good to know.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using the Debug mode ((F10) V.S 2005
    By csonx_p in forum Windows Programming
    Replies: 21
    Last Post: 06-17-2008, 05:06 PM
  2. Why my code works only in debug mode?
    By pingpangpang in forum C++ Programming
    Replies: 3
    Last Post: 06-04-2007, 12:39 PM
  3. Results in Debug and Release mode are different
    By jaro in forum C Programming
    Replies: 11
    Last Post: 05-27-2006, 11:08 AM
  4. Debug Mode Vs. Release Mode
    By incognito in forum Tech Board
    Replies: 5
    Last Post: 12-18-2003, 04:06 PM
  5. 2min in debug mode, 3sec in release!
    By glUser3f in forum C++ Programming
    Replies: 9
    Last Post: 10-03-2003, 01:00 PM