Sponsored Content
Full Discussion: need help with c
Top Forums Programming need help with c Post 302399262 by pavun_cool on Friday 26th of February 2010 10:59:39 PM
Old 02-26-2010
Using fgets function

Quote:

Use this following code, it will give you the last line of the file content
Here I have implemented, Franklin idea.

Code:
 

#include<stdio.h>
#include<string.h>

main()
{
        FILE *fp ;
        char line[80];
        char temp[80];
        fp = fopen ("text","r") ;  // Open the file
        while (fgets (line,80,fp)!= NULL );
        printf ( "%s",line ) ; // displaying the last line
}

 
SPE(1)							      General Commands Manual							    SPE(1)

NAME
spe -- Platform independent pluggable Python IDE SYNOPSIS
spe [-d, --debug] [-w, --workspace] [<script-name1> <script-name2>] DESCRIPTION
This manual page documents briefly spe. This manual page was written for the Debian distribution because the original program does not have a manual page. spe (Stani's Python Editor) is an Integrated Development Editor for the Python programming language (fully compatible with Blender). spe has an editor with syntax highligthing and code completion, can generate UML diagram and code documentation using pydoc. spe is written using wxWidgets and integrate wxGlade and XRCed as plugins to make GUI creation easier. spe can also use pychecker for code check and win- pdb to debug python code. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. -d --debug Prints debug information usefull to add to bug report. -w --workspace Start spe with the selected workspace. If none spe opens the default workspace. AUTHOR
This manual page was written by Stefano Canepa <sc@linux.it> for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2, as published by the Free Soft- ware Foundation. On Debian systems, the complete text of the GNU General Public License, Version 2, can be found in /usr/share/common-licenses/GPL-2. SPE(1)
All times are GMT -4. The time now is 02:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy