Jump to content
  • Advertisement

Jareds411

Member
  • Content Count

    24
  • Joined

  • Last visited

Community Reputation

108 Neutral

About Jareds411

  • Rank
    Member
  1. I have a line of code as such: system("edit C:\\My Documents\\test.txt"); The problem is, it doesn't see the space. How do I get it to use the space between My and Documents?
  2. I have a line of code as such: system("edit C:\\My Documents\\test.txt"); The problem is, it doesn't see the space. How do I get it to use the space between My and Documents?
  3. I made this program to copy a simple text file by passing each character through a buffer variable. However, it gets rid of any spaces or new lines in a file. Can someone help me with fixing it please? #include <iostream> #include <stdlib.h> #include <fstream> #include <cstring> char buff; int main() { ifstream file ( "file.txt" ); ofstream NEW ( "CopyOfFile.txt" ); while ( file.eof() != true) { file >> buff; NEW << buff; } file.close(); NEW.close(); system("PAUSE"); return 0; }
  4. Jareds411

    Ascii character conversion

    Hmm, now I'm confused. I have this code: #include <iostream> #include <stdlib.h> #include <fstream> #include <time.h> int main() { srand(time(NULL)); char test[100]; char buff; int x = 0; cout << "Enter text to encrypt: "; cin >> test; ofstream text ("text.txt"); while (x < 100) { text << test[x]; buff = (97 + rand(26)); text << buff; buff = (97 + rand(26)); text << buff; x++; } system("PAUSE"); text.close(); return 0; } The first time I run it, it works fine. However, if I run it again without deleting "text.txt" first, "text.txt" becomes filled with asian symbols.
  5. Jareds411

    Integer factorization, the fast way?

    This should do the trick. #include <stdlib.h> #include <iostream.h> int main() { __int64 number, j, k; short int again; system("cls"); cout << "\n\n\t\t\t Prime Finder\n\n"; cout << "\n\n\t\t\t By: Jared Stewart.\n\n\n\n\n\t\t "; system("PAUSE"); system("cls"); do { system("cls"); cout << "Please enter a number to get the prime factors: "; cin >> number; j = 2; system("cls"); cout << "The prime factors are: "; do { if (number == 2) break; if (number % j == 0 ) //check if its a factor { cout << j << " "; number = number/j; //make the number to check smaller } else j++; } while (j < 3); for (j =3; j <= sqrt(number); ) { if (number % j == 0 ) //check if its a factor { cout << j << " "; number = number/j; //make the number to check smaller } else j+=2; } cout << number; cout << "\n\n"; cout << "To test a new number, press 1. To quit, press 2.\n\n\n"; cin >> again; } while (again ==1); }
  6. Jareds411

    Ascii character conversion

    A char is not just a number. It can also hold letters, which is what I want it to do. You obviously don't understand ASCII, go google it before you keep repeating yourself. I don't want letter to hold a number 97-122, I want it to hold an ASCII character with a value 97-122, also known as a lowercase letter. ;-)
  7. Jareds411

    Ascii character conversion

    You don't understand what I want. I know how to assign the letter 'a' to a variable. I'm trying to make a random letter basically, by making a random number 97-122, then assigning a variable the ascii character of that number.
  8. Jareds411

    Ascii character conversion

    I was using 'a' as an example. I need it to assign the the of num to letter whatever it's value. I'm going to assign a random number to num, then assign that character to letter.
  9. Does anyone know of a way to assign a variable the ascii character of a given value? For example, 97 is the value of the ascii 'a'. If I have int num = 97; char letter; How would I assign 'a' to letter?
  10. Jareds411

    Bmp to Jpeg

    The link you gave me was broken, but I found it at http://www.screamingstatue.com/jareds411.zip. I tried it out, but it just outputs a 1x1 jpg. :-/
  11. Jareds411

    Bmp to Jpeg

    I just downloaded it, and it requires you to install it.
  12. Jareds411

    Bmp to Jpeg

    Yes, I need it to be command line, and ImageMagik won't work because I forgot to mention it needs to also be stand-alone.
  13. Jareds411

    Bmp to Jpeg

    Does anyone have a command line program to convert bmp's to jpeg's?
  14. How would I make a hotkey to launch a program from anywhere within windows. [Edited by - Jareds411 on September 16, 2004 6:46:49 PM]
  15. Jareds411

    Taking a screenshot

    Thanks, works great now! :-D
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!