Thread: Scan Textfiles

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    No, there is no other way. And no, you shouldn't be using macros for such a lot of code. You should be using functions.
    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.

  2. #17
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    I see. I am not sure how it could be done using a function. Is it possible to use a function to for example "Declare"/tell that:
    Code:
    Something = if (Time > 1652);
    Last edited by Coding; 02-06-2008 at 07:37 PM.

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    No. Macros are preprocessor stuff.
    It parses the source file and replaces all instances of those macros with regular text, so when the compiler starts compiling the code, the text has already been replaced.
    You shouldn't be abusing macros in such a way either.
    You should use template functions when possible.
    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. #19
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    Yes okay, I will take a look at this and see what could be done.
    Thank you for help...

  5. #20
    coder
    Join Date
    Feb 2008
    Posts
    127
    Quote Originally Posted by Coding View Post
    The thing I am after here is to in any way use a headerfile. I have never done this before. As what I understand this is another file like "headerfile.h" I believe.
    A header file is used for specific purposes: why are you trying to use it?
    Perhaps there is a better solution for your problem.
    I'm guessing you just want to separate your code in different files, am I right?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. reading textfiles using variable names
    By rjcarmo in forum C++ Programming
    Replies: 3
    Last Post: 05-13-2003, 02:05 PM
  2. scan multiple items in multidimensional array
    By requiem in forum C Programming
    Replies: 1
    Last Post: 04-17-2003, 03:02 PM
  3. while (scan != 'y' or 'n) or if(scan != 'y' or 'n)
    By Blizzarddog in forum C++ Programming
    Replies: 6
    Last Post: 10-23-2002, 01:16 PM
  4. Scan data from file
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 05-12-2002, 07:52 AM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM