Scan Textfiles

This is a discussion on Scan Textfiles within the C++ Programming forums, part of the General Programming Boards category; No, there is no other way. And no, you shouldn't be using macros for such a lot of code. You ...

  1. #16
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,537
    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
    383
    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 06:37 PM.

  3. #18
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,537
    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
    383
    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?

Page 2 of 2 FirstFirst 12
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, 05:05 PM

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