Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,394 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,140 people online right now. Registration is fast and FREE... Join Now!




Parse error and incompatible error

 
Reply to this topicStart new topic

Parse error and incompatible error

Euniceno1
22 Oct, 2006 - 10:30 PM
Post #1

New D.I.C Head
*

Joined: 22 Oct, 2006
Posts: 3


My Contributions
I need help with following program.
CODE

#include <stdio.h>
#include <ctype.h>

int main(void)
{
   int c, i, j, letter[26][26];

   for (i=0; i<26; ++i) /* init array to zero */
       letter[i] = 0;
   for( j= 0; j<26; ++j)
           letter[j] = 0;
   while((c = getchar()) != EOF) /* count the letter */
        if(isupper© && islower©)
          ++letter[c -> 'A' && c -> 'a'];
   for (i=0; i<26; ++i)
     if(i%6==0)
   for ( j= 0; j<26; ++j)
     if(j%6==0) {
       printf("\n");
     printf("%4c%4c:%3d%3d", 'A' || 'a' +i +j, letter[i][j]);
   }
   printf("\n\n");
   return 0;
}


edit: added [code] tags ~ jayman9
User is offlineProfile CardPM
+Quote Post

NyeNye
RE: Parse Error And Incompatible Error
22 Oct, 2006 - 10:53 PM
Post #2

D.I.C Head
**

Joined: 24 Sep, 2006
Posts: 248


My Contributions
why did you put "int main(void)" be specific..

int main- return a value

void main- doesn't return a value
User is offlineProfile CardPM
+Quote Post

gregoryH
RE: Parse Error And Incompatible Error
22 Oct, 2006 - 11:56 PM
Post #3

D.I.C Regular
Group Icon

Joined: 4 Oct, 2006
Posts: 417


Dream Kudos: 50
My Contributions
QUOTE(Euniceno1 @ 22 Oct, 2006 - 11:30 PM) *

I need help with following program.
#include <stdio.h>
#include <ctype.h>

int main(void)
{
int c, i, j, letter[26][26];

for (i=0; i<26; ++i) /* init array to zero */
letter[i] = 0;
for( j= 0; j<26; ++j)
letter[j] = 0;
while((c = getchar()) != EOF) /* count the letter */
if(isupper© && islower©)
++letter[c -> 'A' && c -> 'a'];
for (i=0; i<26; ++i)
if(i%6==0)
for ( j= 0; j<26; ++j)
if(j%6==0) {
printf("\n");
printf("%4c%4c:%3d%3d", 'A' || 'a' +i +j, letter[i][j]);
}
printf("\n\n");
return 0;
}

HI Euniceno,

Can you post a question relating to the code you posted?
User is offlineProfile CardPM
+Quote Post

NyeNye
RE: Parse Error And Incompatible Error
23 Oct, 2006 - 12:24 AM
Post #4

D.I.C Head
**

Joined: 24 Sep, 2006
Posts: 248


My Contributions
I guest he/she posted the problem at his/her titles...

regarding concern with his/her......
User is offlineProfile CardPM
+Quote Post

Trogdor
RE: Parse Error And Incompatible Error
23 Oct, 2006 - 04:33 AM
Post #5

D.I.C Addict
Group Icon

Joined: 6 Oct, 2006
Posts: 533



Thanked: 3 times
Dream Kudos: 125
My Contributions
Euniceno1, can you post in the code enclosed in [ code ] tags so that it becomes readble, and post the exact error message you get ?
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 02:41AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month