Thread: here is my code someone help please

  1. #1
    kris
    Guest

    Unhappy here is my code someone help please

    #include<iostream.h>
    #include <fstream.h>
    #include <string>
    #define WORD_LENGTH 80
    #define length_word 70
    typedef char word[WORD_LENGTH];
    word string[WORD_LENGTH];
    int len = 14;
    char words[length_word];





    int main()
    {
    char string[WORD_LENGTH];



    ifstream in("dictionary.txt");


    while ( in >> string)
    {

    for(int i = 0; i < len; i++)

    string[i]++;
    }
    in.close();

    ifstream get("input.txt");

    ofstream out("misspelled.txt");

    while ( get >> words)
    {

    for(int i = 0; i < 6; i++)

    words[i]++;
    }

    if( strcmp(words, string) == 0 )

    cout << words;




    get.close();

    out.close();

    return 0;

    }

  2. #2
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question What is wrong?

    What is it that happens(error?)
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  3. #3
    "The Oldest Member Here" Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,039
    I don't get it.

  4. #4
    Unregistered
    Guest
    there is no error, it doesnt work...for soem reason the arrays dont work and str cmp doenstn read antyhing

  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    I can't look at it right now, but if you'd attach the data files that the program uses I'll see if I can find the problem sometime tommorow.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extended ASCII Characters in an RTF Control
    By JustMax in forum C Programming
    Replies: 18
    Last Post: 04-03-2009, 08:20 PM
  2. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 07:34 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM