[ns] Error: "Cannot convert int to FILE*" - File pointer error

jimit shah jimitjshah at gmail.com
Wed Mar 5 05:14:26 PST 2008


With the following code in my '.cc' file, I'm getting a file pointer
error saying that
"Cannot convert int to FILE*". I have also attached the screenshot of the error.
Please help me get around the problem ASAP. I'm working on ns-2.27 on
RedHat Linux 9.0 platform.
following are the lines of code :
===================================================================
#include "ourapp.h"
#include<iostream.h>
#include<string>
#include<stdlib.h>
#include <fstream>
#include <stdio.h>
static rstation res[10];
static cache rc[10],wc[10];
static int cnt=0,expseqno=1;
static int rcnt=0,wcnt=0;
const int rs=10;
const int c=10;
static int k=0;
FILE* fp;
fp = fopen("/root/ns/ns-allinone-2.27/ns-2.27/iSCSI/output.txt", "w");
fprintf(fp,"Enter the program");
.
.
.
================================================================
--
jjs


More information about the Ns-users mailing list