EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group

 

Affiliates



The Urinal

hackhound.org

suck-o.com

hack.org.za

flyninja.net

 

Enigma Group's Code Bank


Adds line numbers

By: mofm  -  Date Submitted: 2009-07-25 17:31:13

  1. /*
  2.  
  3. fileex1.c
  4.  
  5.  
  6.  
  7. Input a text file a line at a time and output the
  8.  
  9. contents to the screen together with the line number.
  10.  
  11.  
  12.  
  13. */
  14.  
  15.  
  16.  
  17. #include <stdio.h>
  18.  
  19. #include <stdlib.h>
  20.  
  21.  
  22.  
  23. FILE *fpin /* Define file pointer */
  24.  
  25. char file_name[13]
  26.  
  27.  
  28.  
  29. void process_files(void)
  30.  
  31. {
  32.  
  33. char buff[80]
  34.  
  35. int line_count
  36.  
  37.  
  38.  
  39. line_count=1
  40.  
  41. while(fgets(buff,80,fpin)!=NULL) /* Read in lines until EOF */
  42.  
  43. {
  44.  
  45. printf("%4d %s",line_count++,buff)
  46.  
  47. }
  48.  
  49. } /* End process_files */
  50.  
  51.  
  52.  
  53. void open_files(void)
  54.  
  55. {
  56.  
  57. printf("Enter filename : ")
  58.  
  59. scanf("%s",file_name)
  60.  
  61. if((fpin=fopen(file_name,"r"))==NULL) /* open file - with check */
  62.  
  63. { /* Display error on fail */
  64.  
  65. printf("Cannot open file %s",file_name)
  66.  
  67. exit(1)
  68.  
  69. }
  70.  
  71. } /* End open_files */
  72.  
  73. void main(void)
  74.  
  75. {
  76.  
  77. open_files()
  78.  
  79. process_files()
  80.  
  81. fclose(fpin)
  82. return 1
  83.  
  84. } /* End of main program */
  85.  
Return to ajax category list

Who Visited EnigmaGroup Today?

1582 Guests, 268 Users (183 Spiders)
Rex_Mundi, hackaday, hkevin, whoami, limited, Caddyamilla, NIGHTWOLF, dark_void, Cockelala, Xendz, strudels, trueorfalse, Klosse, ddxc, whisperer, GothicLogic, Blavatsky, InjectioN, Hessesian, Bumpadjuppy, DrOptix, blackknight911, Effomeidonize, Distorted, JohnMalkovitzch, TheHarrisonW, Obop, ellisp, Vreality2007, advenlydent, zach, suetekh, Vengeance987, m0rt, 2345, electro-technic, riesenjoe, IvanDimitriev, nmobin27, RomeoG, timetrust, 2142, 3ntr0py, BillTuer, advilapyday, lotato, lonely.connection, CloverCipher, vnd, aurena, rospark, valy1177, learning, st3alth, Partisan, K0gller, fitz, Jayjay, psychomarine, Vspectrum, San Marino, TinCardinal, brunoriversyhn, code-g, yshiau, Psiber_Syn, Seasharp, obencefoozy, SlayingDragons, Link-, tinuigimeni, jasonbourne, Fred, somebody777, Meonkzt, CJ_Omaha, jearrorne, cls777, unsugsNashy, Balksnuntails, Sir D. Naut, batsbargy, Rik, Macabre, Nightraven, Iccyx, Repuhlsive, vipervince2002, Janomatrix, lol, veceattainc, techno, Exclaw, Nikhil, evjfvir967nj, Mod777, nermtode, Tjm, bjy1997, hecky, saraf, elprof, damoniceht, trik, jordan86, SnoopSky, dan_movie, OnetInsolefon, darkfire1515, seojlhmyrhwh, Thoplehap, MaxMeier, 1028rajeev, Abhinav2107, autotuneuser, alexelixir, Tauya, Jozinbrejl, kernel_mod, quolc, anandoump, vladavlada, Taicadine, AnnaNoult, GreenTiger, baripadatimes, Ewing, Blackbeard, thepuppeteer, BON-SELE, hak4r, Unotohumsmush, m4f10, avacraft, becool, thecoder, n01se, alpha1, saki, ObesseJew, ActictGlync, sajan, unicornrainbow, Domihoolbob, matt.14, max66, SnowFury, Spud101, myfabregas, Ausome1, kajman121, Frudopvia, ideveloper6, OLOLO, Bugshuppy, lamb, VagWirura, LialiTiTviors, Ordeptpen, scifics, Pozycj-Z21, Gkjt, interPuscruse, aaftab, TheCheeseDemon, blackcyxx21, jollyjimbo, N4g4c3N, rineDriekly, Rap70r, Xargos, flarornEral, ovetz13, sonu sahu, Breezy, emitleBen, Hackpad, JWTSR, nicyun, kaizo, itevainee, luke460, AverageJoe, zeratu92, litbk, Mr.Pickle, mannavard1611, LoopyLion, NexusVos, mtroscheck, burberrybagsjr, nikedunksxm, xordux, jeho, Lonewolf034, Dragonite, nhorton, Reloaded, Odile, Kaptain_k1rk, Teefelltugh, grizzly, posthuman01, jakesboy2, pwnpwnlolz, Sabo, Lakhoamnmek, Røgue, dot_Cipher, mori, snickerless1, cart1m, KELATALFTUS, hubris, Afrika, welepocourl, carpinteyrofbt, ReottphoffBom, Reahastegah, pumashoesld, pdanielt, dmac006, DnA-Ender, Red Fox, couptupleakb, ryanjcrook, iMaxx, sh3llcod3, TimHortons, EmilaHapsaums, Feld Grau, burgeoningneophyte, Maroonhat, CookieAu, tinkansinar, Mitodina, timberlandoutletlufc, zsefvy, guccioutletox, AlexDiru, AbercrombieFitchhl, Ryuske, r0z4, slchill, kalak55, Ph4Kt480ii, beefarn, Jigoku, WrossyJes, pollolololo, ZepSung, Fragility, jell0, C9019, Othrguy, Noticon, KIKNWING, llasarus, mdubz, leah027, iellswo, MAZI_, Estilaamoli, subtentar, Trollorful, no, nas0151, Traybo
 
Enigma Group