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

  • Home
  • SEARCH
  • 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 8024843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:58:33+00:00 2026-06-04T22:58:33+00:00

In function main() {…} 1) #include header file string.h 2) I prototype my own

  • 0

In function main() {…}

1) #include header file string.h

2) I prototype my own file, call it strcpy:

**char *strcpy(char *strSource , const char *dest);**

3) I also wish to use the “real” strlen function in string.h in main().

4) In another compilation file I have my version of strcpy.

Question: How can I get the linker to choose my version of strcpy instead of the prototype in string.h?

enter code here
#include <conio.h>
#include <string.h>
char *strcpy(char *source , const char *dest); 
void main()
{
char *s, *d;
strcpy(s,d);
getch();
}

#include <stdio.h>
char *strcpy(char *strDestination, const char *strSource)
{
char *ptr;
printf("made it!");
return ptr;
}
  • 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-04T22:58:34+00:00Added an answer on June 4, 2026 at 10:58 pm

    You can’t do that in C. That’s one of the reasons why C++ introduces namespaces.

    The only thing you can do is use a non-conflicting name for your own functions.

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

Sidebar

Related Questions

I am trying to do the following: function main(callback) { $.ajax('server-side', function() { this.callback.call(hello);
Suppose I have an object file ( source.o ) without function main . a
Hello ever one I have made a main function and two files one header
Warning: main() [function.main]: Node no longer exists I am loading a ml file via
As I wrote an app with the function main(int argc, char * argv[]) When
I am trying to call another function, foo(), in the Raw class from main.cpp
<?php include(stdio.h); function main() { printf(Hello World); return 0; } ?> Error on line
I am trying to call a C function that is defined in another file.
An example, I have a string that contains let's say: function main { //
#include<curses.h> //includes the curses library so it can be used in the function main()

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.