473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

invalid conversion from int to file

Hi all,

For the following code :

file_ptr = fopen("pass_fail.txt", "a"); // error line 393

fdisplay(file_ptr, "Test Passed");

fclose(file_ptr);

resa = resa + 1;

}

else

{
printf("\nTEST FAILED\n\n\n");

file_ptr = fopen("pass_fail.txt", "a"); //error line 402

fdisplay(file_ptr, "Test Failed");

fclose(file_ptr);

}

}

else

{

if( vube_n.read() == 1 )

{
printf("\nTEST PASSED\n\n\n");

file_ptr = fopen("pass_fail.txt", "a");

fdisplay(file_ptr, "Test Passed");

fclose(file_ptr);

resa = resa + 1;

}

else

{

printf("\nTEST FAILED\n\n\n");

file_ptr = fopen("pass_fail.txt", "a");

fdisplay(file_ptr, "Test Failed");

fclose(file_ptr);

}

}

}

I am getting the error as:
testbench.h: In member function `void
testbench::always_process_238()':
# testbench.h:393: invalid conversion from `FILE*' to `int'
# testbench.h:394: `fdisplay' undeclared (first use this function)
# testbench.h:394: (Each undeclared identifier is reported only once
for each
# function it appears in.)
# testbench.h:395: invalid conversion from `int' to `FILE*'
# testbench.h:402: invalid conversion from `FILE*' to `int'
# testbench.h:404: invalid conversion from `int' to `FILE*'
# testbench.h:414: invalid conversion from `FILE*' to `int'
# testbench.h:416: invalid conversion from `int' to `FILE*'
# testbench.h:423: invalid conversion from `FILE*' to `int'
# testbench.h:425: invalid conversion from `int' to `FILE*'

How to resolve the above error??where is the mistake??

regards,
fazal

regards,
fazal

May 24 '07 #1
3 7125
What have you got file_ptr declared as? It should be

FILE *file_ptr;

I'm guessing due to all the type conversion errors you're getting that
you have it declared as an int.
May 24 '07 #2

Keith Halligan wrote:
What have you got file_ptr declared as? It should be

FILE *file_ptr;

I'm guessing due to all the type conversion errors you're getting that
you have it declared as an int.

hai,

Thanks...its really worked ....but the following:
fdisplay(file_ptr, "Test Passed");

giving error as..

`fdisplay' undeclared (first use this function)
Each undeclared identifier is reported only once for each function it
appears in.)

pls help me to solve..

regards,
fazal

May 24 '07 #3
On May 24, 2:33 pm, fazulu deen <fazulu.v...@gmail.comwrote:
Thanks...its really worked ....but the following:

fdisplay(file_ptr, "Test Passed");

giving error as..

`fdisplay' undeclared (first use this function)
Each undeclared identifier is reported only once for each function it
appears in.)
I haven't a clue what fdisplay does, it's not part of either the C or C
++ standard library as far as I know.

The reason it can't find the function is because you're making a call
to it, but the compiler can't find it. So if you know what libraries
and headers it's contained in then give that information to the
compiler and it will stop giving you the warning.
May 24 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Roy Smith | last post by:
I've got a function that takes a couple of optional keyword arguments. I want to check to make sure I didn't get passed an argument I didn't expect. Right now I'm doing: conversion = None drop...
30
by: Tim Johansson | last post by:
I'm new to C++, and tried to start making a script that will shuffle an array. Can someone please tell me what's wrong? #include <iostream.h> #include <string.h> int main () {...
6
by: Thomas Barth | last post by:
Hi, I'm new to windows programming and still reading a book about windows-programming with C++. I copied the following code from the book into my ide (Eclipse/CDT) to comprehend the code, but two...
8
by: Abhijit Bhadra | last post by:
Hi , I am using gcc version 3.3.2. While compiling this code struct sockaddr_in *CBaseSocket::GetSocketName() { socklen_t iLen; cCriticalSocket.Lock(); //...
10
by: jeff regoord | last post by:
A user inputs a float value. The scanf() function gets the value. However, I need to create an error handler with an if else statement saying invalid input if the input is not a number. Does...
3
by: Anders Jansson | last post by:
Hi all. I have 2 problems when I try to open and convert an ASP.NET VS 2003 web-applikation in VS 2005. In VS 2003 I have no problems at all! First: One subfolder with will not be converted!...
5
by: Martin Jørgensen | last post by:
Hi, I'm using this alloc_mem-function (by Michael Mair): - - - - - - - - - - - - - - - - - - - - - - - - void *alloc_mem (size_t num_elems, size_t elem_size, char *filename, int line,...
2
by: tkirankumar | last post by:
Hi all, uname -a SunOS cbmrsd1a1 5.10 Generic_118833-17 sun4us sparc FJSV,GPUZC-M g++ -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2/specs Configured with:...
0
by: Lou Evart | last post by:
DOCUMENT CONVERSION SERVICES Softline International (SII) operates one of the industry's largest document and data conversion service bureaus. In the past year, SII converted over a million...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.