943,580 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 417
  • C RSS
Jul 3rd, 2008
0

is it true?!!

Expand Post »
i want to make a text programe ,this program supposed to have a text mode and a command mode;
in text mode you can type and whit arrow key change your position
in command mode by typing your comman you can get the results for example:
by typing copy 2 3 5 the program will go to line 2 and then to character 3 and then counts 5 character and copies them in to anoter array (clipboard[][]),
a know that code bellow has lots of problems so i need your help
thank u,
  1. void text(char txt[20][4]){
  2. char ch;
  3. clrscr();
  4. gotoxy(45,0);
  5. printf("text mode");
  6. for(y=0;y<=4;)
  7. {
  8. for(i=0;i<=20;i++){
  9. ch=getch();
  10.  
  11. if (ch==13||ch==0)
  12. pos(ch);
  13.  
  14. putch(ch);
  15. txt[i][y]=ch;
  16. }//end of for
  17. y=y+1;
  18. }//end of outer for
  19. }
  20. //****************************
  21. void pos(char ch){
  22. if (ch==13){
  23. i=1;
  24. y=y+1;
  25. gotoxy(i,y);
  26. }
  27. else if(ch==0){
  28.  
  29. ch=getch();
  30. if(ch==77){
  31. i=i+1;
  32. gotoxy(i,y);
  33. }
  34. else if(ch==72){
  35. y=y-1;
  36. gotoxy(i,y);
  37. }
  38. else if(ch==80){
  39. y=y+1;
  40. gotoxy(i,y);
  41. }
  42. else if(ch==75){
  43. i=i-1;
  44. gotoxy(i,y);
  45. }
  46. }// end of first else if
  47. }
Last edited by Narue; Jul 3rd, 2008 at 8:45 am. Reason: Adde
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xlx16 is offline Offline
10 posts
since May 2008
Jul 3rd, 2008
0

Re: is it true?!!

Shouldn't your program have an int main() function, too?

Reputation Points: 416
Solved Threads: 181
Nearly a Posting Virtuoso
Adak is offline Offline
1,463 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Unable to delete compiled programs?
Next Thread in C Forum Timeline: error: incompatible types in assignment





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC