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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:01:26+00:00 2026-05-22T15:01:26+00:00

I am making a command line program in C using XCode. When running the

  • 0

I am making a command line program in C using XCode. When running the program, it initially does what it is supposed to do (asks me for a file path). However, when I type in a valid and existing file path, it gives me the following error:

Program received signal:  “EXC_BAD_ACCESS”. sharedlibrary apply-load-rules all (gdb)

I have two warnings in my program, both of which have to do with the function strcat. The warnings are:

warning: implicit declaration of function 'strcat'

and

warning: incompatible implicit declaration of built-in function 'strcat'

I am wondering why my program is not executing properly.

Thanks,
Mike

My code is posted below:

#include "stdlib.h"
int main (void)
{
   char *string1;
   printf("Type in your file path: ");
   scanf("%s", string1);
   char *string2 = "tar czvf YourNewFile.tar.gz ";
   strcat(string2, string1);
   system(string2);
}

Maybe it has to do with allocating the chars?

  • 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-22T15:01:26+00:00Added an answer on May 22, 2026 at 3:01 pm

    Examine this line:

    char *string1
    

    and this line:

    scanf("%s", string1);
    

    You have not declared a size for string1, meaning that you will always get an error, fix it with something like this:

    char string1[100]

    If 100 is the maximum length of your input.

    Or read your input character by character.

    And, to get rid of the warnings, add #include "string.h" to where your #include statements are.

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

Sidebar

Related Questions

Hello i am making a program that is supposed to copy a text file.
How does one go about making programs that accept added arguments at command line?
When making changes using SubmitChanges() , LINQ sometimes dies with a ChangeConflictException exception with
I want to make a simple program. Don't really care what it does, actually.
Best reader, I'm stuck on one of my concepts. I'm making a program which
I'm making a simple tool that will get a string of MySQL commands and
Making echo of a question around the web: Is the syntax for svn:ignore patterns
After making some changes in my models (eg. new field in a model and
After making a few modifications to a rails app I am tinkering on, railroad
Im making a small python script to upload files on the net. The script

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.