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 7879155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:50:20+00:00 2026-06-03T03:50:20+00:00

I am having the above mentioned compile error. The line of code is this:

  • 0

I am having the above mentioned compile error. The line of code is this:

if ((strcmp(tempDept, data[1].Dept)==0) && tempCourse == data[i].course){
            if (tempDay = data[i].meet_days &&
                tempTime == data[i].start.hour){  //<---This line
                    printf("this worked");
            }
        }

Here is my structs declarations:

typedef enum {MW, TR} days;

typedef struct {
  int hour, min;
} Time;

typedef struct {
  char Dept[5];
  int course, sect;
  days meet_days;
  Time start, end;
  char instr[20];
} sched_record;

And here is my list off variables:

int switchInput;
int i = 0;
int tempCourse = 0;
char tempDept[5];
char tempDay[2];
int tempTime;
//char tempTime[1];
FILE *filePointer;
sched_record data[MAX_RECORD];

Can someone tell me how to fix this?

  • 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-06-03T03:50:22+00:00Added an answer on June 3, 2026 at 3:50 am
    tempDay = data[i].meet_days
    

    This couses a problem because tempDay is char array of length 2 and meet_days is enum days. And in C constants in enums are just of int type. Another problem that you can’t assign int to char array itself. Maybe you wanted an equal sign == ?
    Now you must think how to convert int enum value to char[2]. One way is use sprintf() to accomplish that. But concrete implementation depends on your interpretation of enum constants.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code that I am having trouble with is this line: result.addElement(&(*(setArray[i]) + *(rhs.setArray[j])));
Having this code: using (BinaryWriter writer = new BinaryWriter(File.Open(ProjectPath, FileMode.Create))) { //save something here
Having a list of data object and something visual to represent each, where would
I'm having trouble finding the answer to this question anywhere. I am in need
Im having an error that says: Request-URI Too Large Actually I'm trying to add
I was trying to compare the three above mentioned platforms and what considerations one
I have this macro code, which allows me to define both a C enum
Having a bit of a problem, Due to the source-control set-up we use, each
Having volunteered to maintain a stagnant CPAN package (GnuPG) I'd like improve the install
Having some issues getting my head around the differences between UTF-8, UTF-16, ASCII and

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.