help....

Discussion in 'C Programming' started by Jeevan, May 4, 2004.

  1. Jeevan

    Jeevan Guest

    Dear all,

    I want to get the header name from a data file and include it in the
    function.
    FOr eg.

    program main
    character*80 getheader
    open (1, file = 'input.doc', access= 'sequential',
    & status = 'old')
    read(1,'(A)')getheader
    close(1)

    call function(getheader)

    end program main

    subroutine function(getheader)

    character*80 header

    # include "getheader"
    ...............
    .............

    end


    Now the problem is that it is not acceptimg the getheader
    To be noted is that getheader conatins the path of the header
    file...say ../inc/read.h

    The error that i get is getheader is not a file or directory..

    PLZZ can anyone throw light on this!!!!
    Jeevan, May 4, 2004
    #1
    1. Advertising

  2. Jeevan <> scribbled the following:
    > Dear all,


    > I want to get the header name from a data file and include it in the
    > function.
    > FOr eg.


    > program main
    > character*80 getheader
    > open (1, file = 'input.doc', access= 'sequential',
    > & status = 'old')
    > read(1,'(A)')getheader
    > close(1)


    > call function(getheader)


    > end program main


    > subroutine function(getheader)


    > character*80 header


    > # include "getheader"
    > ..............
    > ............


    > end


    Whatever language this is, it's not C. Do you have your newsgroups
    confused? Or is this some kind of pseudo code?

    > Now the problem is that it is not acceptimg the getheader
    > To be noted is that getheader conatins the path of the header
    > file...say ../inc/read.h


    > The error that i get is getheader is not a file or directory..


    > PLZZ can anyone throw light on this!!!!


    AFAIK you want some kind of way to determine the name of an #included
    header file at run-time, by calling a function in the C program.
    Because the preprocessor works even before the compiler, let alone
    the actual running, this is by its very nature impossible. You have
    to make this a two-pass compile: make one C program to get the header
    file name and output C source code, save it as a second C program,
    and compile it.

    --
    /-- Joona Palaste () ------------- Finland --------\
    \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
    "I am looking for myself. Have you seen me somewhere?"
    - Anon
    Joona I Palaste, May 4, 2004
    #2
    1. Advertising

  3. In article <>, "Jeevan"
    <> wrote:


    > Dear all,
    > I want to get the header name from a data file and include it in the
    > function.
    > FOr eg.
    > program main
    > character*80 getheader
    > open (1, file = 'input.doc', access= 'sequential',
    > & status = 'old')
    > read(1,'(A)')getheader
    > close(1)
    >
    > call function(getheader)
    > end program main
    > subroutine function(getheader)
    > character*80 header
    > # include "getheader"
    > ..............
    > ............
    > end
    > Now the problem is that it is not acceptimg the getheader To be noted is


    It looks like the problem is that this is *not* C.
    Mark A. Odell, May 4, 2004
    #3
  4. Jeevan

    Alan Balmer Guest

    On 4 May 2004 10:15:28 -0700, (Jeevan) wrote:

    >Dear all,
    >
    >I want to get the header name from a data file and include it in the
    >function.
    >FOr eg.
    >
    >program main
    > character*80 getheader
    > open (1, file = 'input.doc', access= 'sequential',
    > & status = 'old')
    > read(1,'(A)')getheader
    > close(1)
    >
    > call function(getheader)
    >
    >end program main
    >
    >subroutine function(getheader)
    >
    >character*80 header
    >
    ># include "getheader"
    >..............
    >............
    >
    >end
    >
    >
    >Now the problem is that it is not acceptimg the getheader
    >To be noted is that getheader conatins the path of the header
    >file...say ../inc/read.h
    >
    >The error that i get is getheader is not a file or directory..
    >
    >PLZZ can anyone throw light on this!!!!


    Fortran? Not C, in any case. Wrong newsgroup.

    --
    Al Balmer
    Balmer Consulting
    Alan Balmer, May 4, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?dHJlbGxvdzQyMg==?=

    HELP! HELP! HELP! Opening Web Application Project Error

    =?Utf-8?B?dHJlbGxvdzQyMg==?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    761
    =?Utf-8?B?dHJlbGxvdzQyMg==?=
    Feb 20, 2004
  2. Harvey
    Replies:
    0
    Views:
    691
    Harvey
    Jul 16, 2004
  3. Harvey
    Replies:
    1
    Views:
    834
    Daniel
    Jul 16, 2004
  4. =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=

    HELP - HELP - HELP

    =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    677
    Eliyahu Goldin
    Mar 9, 2006
  5. Buster

    Help, Help, Help

    Buster, Oct 4, 2003, in forum: Java
    Replies:
    3
    Views:
    469
    Saager
    Oct 30, 2003
Loading...

Share This Page