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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:51:15+00:00 2026-05-20T04:51:15+00:00

In What lines will this code fail (meaning: don’t do what they are supposed

  • 0

In What lines will this code fail (meaning: don’t do what they are supposed to do), and why?

int main(void) {
 char student[64] = "some guy";
 char* teacher;

 /* line1 */ strcpy(teacher, student);
 /* line2 */ teacher=student;
 /* line3 */ strcpy(student, "Alber Einstein");
 /* line4 */ student = teacher;
}
  • 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-20T04:51:15+00:00Added an answer on May 20, 2026 at 4:51 am

    Line 1 causes undefined behaviour. Line 4 won’t even compile. Since this seems like it could just as easily be a homework question, and I don’t like to give the whole thing away, a quick read of the comp.lang.c FAQ or the C language specification will explain why.

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

Sidebar

Related Questions

I have three tables. This query will write down the right answer (x-lines for
Please suggest some free tools which will help me to get Lines-of-Code metrics for
#include <cstdio> #include <QtCore/QProcess> int main (int argc, char** argv) { // if we
I have this code Dim parts As New List(Of String)(Regex.Split(RichTextBox2.Text, ~\d)) That splits lines
I am looking for a command that will accept (as input) multiple lines of
You will notice the :hover CSS for the links in the main nav area
Links to point me in the correct direction, or sample code will be appreciated.
I have a piece of code that may or may not fail, which I
oXML = Server.CreateObject(Msxml2.DOMDocument.4.0) oNode = oXML.createElement(CommonCustomerSearch) can someone explain what the lines of code
When compiling this code I get: fatal error C1083: Cannot open include file: 'fstream.h':

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.