help....

J

Jeevan

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!!!!
 
J

Joona I Palaste

Jeevan said:
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"
..............
............

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.
 
M

Mark A. Odell

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.
 
A

Alan Balmer

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help with code 0
Help with code plsss 0
Help in this program. 2
Can't solve problems! please Help 0
Help with Visual Lightbox: Scripts 2
Code help please 4
I need help making an html website 2
Help with pointers 1

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top