Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 30th, 2005, 4:56 PM   #11
Silvanus
Hobbyist Programmer
 
Silvanus's Avatar
 
Join Date: Aug 2005
Location: Hiding from... them...
Posts: 110
Rep Power: 4 Silvanus is on a distinguished road
Quote:
Originally Posted by ivan
I am not really a beginner in programming, I am just a beginner in C.
I apologize, but I think my point still holds.
Silvanus is offline   Reply With Quote
Old Sep 30th, 2005, 5:41 PM   #12
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
This goes back to the two types of programmers: the arrogant, and the insecure.
__________________

tempest is offline   Reply With Quote
Old Sep 30th, 2005, 5:53 PM   #13
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5 bl00dninja is on a distinguished road
absolutely, as programming skill has little to do with knowledge of syntax or knowledge of available libraries. work your potential man!!!

don't disregard posts that may appear to be condescending (sp?) when they are actually there to help. the language barrier is dificult to overcome, and we understand. also, don't worry about crazy posts about your english, (honestly an (american) retard speaks better english than you) and those guys might not know your situation.

good luck!
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote
Old Oct 1st, 2005, 3:56 AM   #14
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
I've studied English language for only one year, and this is one way for learning it.
Also, it would be very helpfull for me if you guys wanted to correct me in my grammar mistakes that I made with your posts.
Thank you.
ivan is offline   Reply With Quote
Old Oct 1st, 2005, 11:41 AM   #15
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest


Grammar
Spelling



English language is a noun, and your first sentence should be written like this to sound more clear:

I've studied the English language for only one year, and this is one way to learn it.

-- or --

I've studied the English language for only one year, and this is one method for learning it.

Theoretically, the second change in your sentence is correct as far as english grammatics go, it's just hard to read...

--------

Also, it would be very helpful for me if you guys wanted to correct me in my grammar mistakes that I make with your posts.

--or--

Also, it would be very helpful for me if you guys wanted to correct me in my grammar mistakes that I have made with your posts.


You have to indicate your tense before the use of the verb.
__________________

tempest is offline   Reply With Quote
Old Oct 1st, 2005, 12:06 PM   #16
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
Thank you tempest I will remember that.
ivan is offline   Reply With Quote
Old Oct 1st, 2005, 4:00 PM   #17
Mad_guy
Hobbyist Programmer
 
Mad_guy's Avatar
 
Join Date: Oct 2004
Location: Sandstorm, Techno Club
Posts: 239
Rep Power: 4 Mad_guy is on a distinguished road
Send a message via AIM to Mad_guy Send a message via MSN to Mad_guy
I exhort you to try and enhance this algorithm in some fashion, since it can be solved with mere frequency analysis as of current.
Mad_guy is offline   Reply With Quote
Old Oct 2nd, 2005, 1:11 AM   #18
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Here's something i wrote a while back... it's not XOR but it's encryption...

[php]#include <iostream>

using namespace std;

char *enc(char *str, char *key) {
int k = 0;
char *newKey = (char *)malloc(strlen(str));
strcpy(newKey, str);

for(int i=0;i<strlen(str);i++) {
newKey[i] = (char)((int)str[i] + (int)key[k]);
k = ((k == strlen(key)-1)?0:k+1);
}

return newKey;
}

char *dec(char *str, char *key) {
int k = 0;
char *newKey = (char *)malloc(strlen(str));
strcpy(newKey, str);

for(int i=0;i<strlen(str);i++) {
newKey[i] = (char)((int)str[i] - (int)key[k]);
k = ((k == strlen(key)-1)?0:k+1);
}

return newKey;
}

int main(int argc, char *argv[]) {
char *str = enc("this is a test", "cheese");
printf("Encrypted: %s\n", str);
printf("Decrypted: %s\n", str, dec(str, "cheese"));
cin.get();
return 0;
}[/php]
__________________

tempest is offline   Reply With Quote
Old Oct 2nd, 2005, 4:05 AM   #19
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
Isn't working for me tempest...

The Output is:

Encrypted: ╫╨╬╪ô╬╓ê╞àτ╩╓▄
Decrypted: ╫╨╬╪ô╬╓ê╞àτ╩╓▄
ivan is offline   Reply With Quote
Old Oct 2nd, 2005, 4:58 AM   #20
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
I optimized a little my code.
Now the file name may contain spaces and you can specify also the full location of the file. Also, you can enter the file name of the output file ( again, it can be only the file name or the full location ).
The code:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
  char fileName[129];
  char outputFile[129];
  int temp;
  FILE *fp;
  FILE *fp1;
  
  printf( "Text Encoder 1.0 \n\n" );
  printf( "Enter the file name you want to encrypt/decrypt: \n" );
  printf( "The lenght of the file name may not contain then 128 chars. \n" );
  printf( "You may also enter the location of the file. \n" );
    
  gets( fileName );
    
  if((fp = fopen( fileName, "r" )) == NULL) 
  {
         printf( "That file doesn't exist!!! \n\n" );
         system( "PAUSE" );
         return 0;
  }

  printf( "Enter the name of the output file. \n" );

  gets( outputFile );
  
  fp1 = fopen( outputFile, "w" );
  
  printf( "Processing.... please wait \n" );
  
  while( temp != -1 )
  {
         temp = fgetc( fp );
         if( temp == -1 ) break;
         temp = temp ^ 1926701;
         fputc( temp, fp1 );
  } 
  
  printf( "Done. \n \n" );
  
  system("PAUSE");	
  return 0;
}
ivan is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC