Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7547509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:28:15+00:00 2026-05-30T09:28:15+00:00

This is my second C assignment and we have been told to recreate a

  • 0

This is my second C assignment and we have been told to recreate a version of Conway’s Game of Life. I am using a struc (typedef) to hold my 2d array of ints for the grid created with:

typedef int TableType[HEIGHT][WIDTH];

HEIGHT & WIDTH are #define constants.

I am trying to use the function below to compare 2 tables. With the following error (no matter what way I try and compare the values):

error: expected expression before '==' token


int compareTables (TableType tableA, TableType tableB){
    int height, width;
    for (height = 0; height < HEIGHT; height++) {
        for (width = 0; width < WIDTH; width++) {
        if(tableA[height][width]) == tableB[height][width])
        return LIFE_NO;
        }
    }
    return LIFE_YES;
}

I am using Code-Blocks as my compiler and can’t seem to find a way to get gccx to work. So, as far as I know ‘stdio.h’ is the only library I can use.

I’ve tried importing pointers and manipulating those with the -> operator to get the values to compare to no avail.
I also use a similar method to copy tables and it seems to compile fine.

Any suggestions??
Please be gentle I’m a nOOb.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:28:16+00:00Added an answer on May 30, 2026 at 9:28 am
    if(tableA[height][width]) == tableB[height][width])
    

    should be

    if(tableA[height][width] == tableB[height][width])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a (hopefully) really simple question - I have been told recently that
I have this in my class When the second function is called php errors
I have been given a homework assignment where I need to create a captcha
This is a school assignment and I have most of it under control, but
I am having problems with my java assignment. I have been working on it
I have been using Oracle(10g.2) as a PHP programmer for almost 3 years, but
I have been working on a college C assignment, and have been trying to
I have been using mysql in a new rails application, but now I wanted
I have been banging my head on this for a few hours and google
I have an assignment that has asked me to copy a file using buffered

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.