u mean i don't know da ligic behind the program,dont' b silly
u mean i don't know da ligic behind the program,dont' b silly
Do u hav win vista try it out,it works,works,works,worksworks
My Linux box is less impressed with your code.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Well, it seems like you are trying to make us believe you have done something REALLY impressive, when all you've done is write a simple DOS based program to write a single character to the screen. As I stated before, I did the same and much more in assembler in 1985, for both colour and monochrome display adapters [no, I'm not saying it's harder in assembler - just that I know what you're doing, and how your code works], 22 years ago. Judging from your writing style, that's probably 5-10 years before you were born.
The code is definitely not able to "Run on any computer" - it ONLY works in 16-bit DOS or any other 16-bit PC environment. It definitely won't work on a Sparc-based SUN [without running it in a software based emulator], or in Windows on Alpha or Itanium [again, without using some sort of emulation code]. It also won't work in Linux, unless you load up the DOS emulator.
So it seems like you believe this will run on any machine, but it definitely can't.
So, I'm still curious as to if you actually understand what you are doing.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Interesting blog sriki, is there anything there at all that is original? or just a bunch of copywrite infringements?
Hey man impressing if u wanna test my skill just write a program like dis
Last edited by Salem; 12-03-2007 at 11:43 AM. Reason: Snip URL - read the rules, this isn't a site which tolerates "warez"
You don't need to make XP genuine. Simply don't buy your operating system from Russia. The dollar is so weak these days I am sure you could afford it. By the way, your link is dead.
Stop trying to show off too. Everything you've showed us is really just duff code.
I took your comment & blank line remover and tidiet it up, so that comments in strings aren't stripped [as they may be important].
I also removed all the "Turbo C" stuff that is completely unnecessary - so now it will compile on most compilers with no problems.
It also uses more safe fgets() instead of gets(). It's not completely safe against errors - if you enter a long string for input file, it will probably crash badly.
--Code:#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { FILE *inFile,*outFile; char fname[20]; int ch; int quote = 0; int done = 0; int nlCount = 0; int inString = 0; int inComment = 0; printf("Enter the file name (.C or .TXT)\n"); fgets(fname,sizeof(fname), stdin); *strchr(fname, '\n') = 0; inFile=fopen(fname,"r"); if(inFile==NULL) { puts("Cannot open the source file!!!"); exit(1); } outFile= fopen("target.c","w"); if(outFile==NULL) { puts("Cannot create target file!!!"); exit(1); } while(!done) { ch=fgetc(inFile); switch(ch) { case EOF: done = 1; continue; case '\n': if (nlCount) continue; nlCount ++; break; case '/': if (inString || inComment) break; if ((ch = fgetc(inFile)) == '*') inComment = 1; else ungetc(ch, stdin); break; case '*': if (!inComment) break; if ((ch = fgetc(inFile)) == '/') { inComment = 0; continue; } else ungetc(ch, stdin); break; case '"': case '\'': if (!inString) { quote = ch; inString = 1; } else { if (quote == ch) inString = 0; } break; case '\\': if (!inComment) fputc(ch, outFile); ch = fgetc(inFile); default: break; } if (!inComment) { if (ch != '\n') nlCount = 0; fputc(ch, outFile); } } puts("DONE!! OP FILE IS \"TARGET.C\"\n"); fclose(inFile); fclose(outFile); return 0; }
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
I think this is appropriate.And he spake a parable unto them, Can the blind lead the blind? shall they not both fall into the ditch?
Luke 6:39
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
That's probably the proverb(s) that I paraphrased, yes. And don't you think that's more suitable?
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Perhaps, but I think we've been more than respectful to him.
At the end of the day, the real issue is the poor newbies that don't know better and think his website is going to teach them to be 1337 h4x0rz that will be able to tear it up with their uber 1337 skillz.