chaostheory12's Profile
Reputation: 1
Apprentice
- Group:
- New Members
- Active Posts:
- 4 (0.02 per day)
- Joined:
- 15-November 12
- Profile Views:
- 35
- Last Active:
Dec 02 2012 01:50 PM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: Morse to text conversion.
Posted 27 Nov 2012
Thank you both so much for your help. I was getting very frustrated trying to figure out why it wasn't working, and this is a very large part of my grade. -
In Topic: Morse to text conversion.
Posted 27 Nov 2012
Figured out how to fix the warning, but it's still giving me gibberish. This is due in 3 hours, and no matter what I do I can't get it to work.I'm not sure if it would help in anyway, but I attached a screen shot of the stuff it prints back. -
In Topic: Morse to text conversion.
Posted 27 Nov 2012
Okay, I'm not sure if this will work because I can't test it to the best of my ability right now. This is what I came up with for translating Morse into text. It compiles, but it returns a warning on line 23 and returns gibberish characters when I test it.
void morsetotext(char mor[]) { char *alpha[]={"abcdefghijklmnopqrstuvwxyz1234567890 "}; char *morse[] = {".-", "-...", "-.-/>/>.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-/>/>", ".-..", "--", "-.", "---", ".--.", "--.-/>/>", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.-/>/>-", "--.", "-----", ".----", "..---", "...--", "....-", ".....", "-....", "--...", "---..", "----." "/"}; char *letter[8]; char *convert[250]; int con_count=0; int let_count=0; int count=0; int index=0; int length=strlen(mor); while (count<length) { for(let_count=0; mor[count]!=' '; let_count++) { letter[let_count]=&mor[count]; count++; } for(index=0; strcmp (letter, morse[index])!=1; index++) { convert[con_count]=alpha[index]; con_count++; } count++; } printf("%s", convert); return; }
The warning it returns is "[Warning] passing arg 1 of `strcmp' from incompatible pointer type". Any ideas on how to fix this. Thanks for any recommendations.
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Private
Friends
chaostheory12 hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
chaostheory12 has no profile comments yet. Why not say hello?