SUMMARY: Solaris 2.8 and gcc-2.95.2

2007-12-24 20:19:00

codeprof at codeprof.com
SUMMARY: Solaris 2.8 and gcc-2.95.2

Thanks to all who replied:
"John T. Douglass" <douglass at anl.gov>
Matthew Stier <Matthew.Stier at fnc.fujitsu.com>
David Evans <David.J.Evans at oracle.com>
Sun System Admin <sysadm at its.brooklyn.cuny.edu>
Noel Hunt <nhunt at lehman.COM>

People fixed my mismatched parentheses and syntax errors. The program
compiled clean. There were some very good suggestions about using

I started looking for editors that will point parentheses and syntax errors.
I I got to www.download.com and got some really good Perl, Java, C and C++
editors that make the coding process enjoyable.

Its mind boggling how much stuff you can download for managing your
projects. I got this nice little Java de-compiler that converts you .class
back to sorce .java. All I did was got to www.download.com and searched
for IDE, programming, Editors etc. Below are the names some good ones that
I found.

Also, someone suggested that I download the O'Reilly code and the code for
all my books from the Internet. I did that, only one of my C books from
1988 did not have code on the Net, the rest I found. In the process I found
some nice (.rtf , hmtl, .pdf) free books on line. I have attached the name
of some of the IDE editors (shareware/freeware) and the URLs for some of the
free books below.

Conner

www.download.com
****************

SynEdit 2.4
Try this full-featured editor for programmers.
OS: Windows 95/98/NT
Freeware

DJ Java Decompiler 2.6.6
Use this Java decompiler to reconstruct original
source code from binary CLASS files.
OS: Windows 95/98/NT/2000
Freeware

Perl Builder 2.0a
Integrate this refined development environment to
help when creating Pearl and CGI scripts.
OS: Windows 95/98/NT/2000

Bloodshed Dev-C++ 4.0
Write and compile C++ programs.
OS: Windows 95/98/NT/2000

etc.

URL: for some free books:
http://www.monumental.com/boat/javaBooksIndex.html
http://www.mindview.net/Books/DownloadSites

ORIGINAL POSTING:
Solaris 2.8
GCC-2.95.2
SPARC-20
GCC compiles with errors:

I am trying to compile C programs using fopen. Attached are two such simple
programs. GCC complaints about fopen not having enough arguments? What I
am looking for is a sample (small) C program that uses fopen and fclose that
someone has actually compiled on a SUN Workstation, the source code. I seem
to be having problems compiling fopen/fclose on HP-UX 10.20 and Solaris 8.

Please disregard typos or errors, I used OCR and a scanner to import the
text here. My OCR software is a little buggy... when importing to MS word it
displays " correctly however, when pasted into .txt " = " (which looks like
a solid block of text) I typed and doubled checked all programs on my
SPARC-20. This particular program is from O'Reilly SVR4 UNIX Programming.

I am making the assumption that the include files stdio.h and its definition
of fopen are still pretty much the same:

FILE *fopen(const char *pathname, const char *type);

/* Program to copy one file to another */
#include <stdio.h>

main()
{

char in_name[25], out_name[25];
FILE *in, *out;
int c;

printf("Enter name of file to be copied: ");
scanf("%24s", in_name);
printf("Enter name of output file: ");
scanf("%24s", out_name);

if ((in = fopen(in_name, "r")) == (FILE *) NULL )
printf("Could not open %s for reading.\n", in_name);
else if ((out = fopen(out_name, "w")) == (FILE *) NULL
printf("Could not open %s for writing.\n", out_name);
else
{
while ((c = getc (in)) != EOF
putc(c, out);

printf("File has been copied.\n");
}

}

Conner McCleod

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

Comments

Got something to say?

You must be logged in to post a comment.