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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:02:03+00:00 2026-06-13T08:02:03+00:00

My professor gave us some code in a Microsoft Word document and said it

  • 0

My professor gave us some code in a Microsoft Word document and said it should be able to compile, but I’m getting all sorts of errors and I don’t know whats wrong because I have no experience whatsoever with C.

It’s an assembly language class and we’re supposed to write assembly code to match what the C code is doing. He told us to run the program in C to get a feel of things.

#include <stdio.h>
#define  SIZE  40

main()
{
    int v[SIZE];
    register int gap, i, j, temp;

    /*  Initialize array to random positive integers mod 256  */
    for (i = 0; i < SIZE; i++)
        v[i] = rand() & 0xFF;

    /*  Display the unsorted array  */
    for (i = 0; i < SIZE; i++)
        printf(“v[%-d] = %-d\n”, i, v[i]);

    /*  Sort the array using a shell sort  */
    for (gap = SIZE / 2; gap > 0; gap /= 2) {
        for (i = gap; i < SIZE; i++) {
            for (j = i - gap; j >= 0 && v[j] > v[j + gap]; j -= gap) {
                /*  Exchange out of order items  */
                temp = v[j];
                v[j] = v[j + gap];
                v[j + gap] = temp;
            }
        }
    }

    /*  Display the sorted array  */
    for (i = 0; i < SIZE; i++)
        printf(“v[%-d] = %-d\n”, i, v[i]);
    }

The errors I get are strays in lines 15 and 31, so each line that has a printf in it.

As3.c: In function ’main’:
As3.c:15: error: stray ’\223’ in program
As3.c:15: error: expected expression before ’%’ token
As3.c:15: error: expected expression before ’%’ token
As3.c:15: error: stray ’\’ in program
As3.c:15: error: stray ’\224’ in program
As3.c:31:error: stray ’\223’ in program
As3.c:31:error: expected expression before ’%’ token
As3.c:31:error: expected expression before ’%’ token
As3.c:31:error: stray ’\’ in program
As3.c:31:error: stray ’\224’ in program

How can I fix this problem?

  • 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-13T08:02:04+00:00Added an answer on June 13, 2026 at 8:02 am

    It looks like some of the characters got “smart”-ified, probably by Microsoft Word or a similar program. You’ll need to do a find-and-replace to change “ and ” to " (and perhaps likewise for other characters, though “ and ” are the only characters complained about in the specific compile-errors you’ve posted).

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

Sidebar

Related Questions

I'm working on some imaging applications from a book my professor gave me. The
Our professor is making us do some basic programming with Java, he gave a
My Professor gave us this class and told us that it won't compile. He
So I'm working on rewriting a program for a professor, and I have some
My professor gave an example located on slide 3 of this pdf : can
Today in the class of Java the professor came up with this example but
Our professor gave us this assignment, where we have a .txt file with the
I'm a student of computer science in Germany. My professor gave use the following
My professor said, that adding multiple layers in the BLL, will make the 3-tier
during a lecture my professor gave examples of several actions involving databases and the

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.