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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:00:36+00:00 2026-05-28T00:00:36+00:00

I have several source code files in a multi-level directory which contain forward declaration

  • 0

I have several source code files in a multi-level directory which contain forward declaration to a function

extern "C" void myPrintf(char *fmt, ...);

I want to remove this declaration from all the files.
I could do a grep which prints the line containing that declaration for all the files but not sure how to pipe it with sed to get the desired result.

  • 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-28T00:00:37+00:00Added an answer on May 28, 2026 at 12:00 am

    With GNU sed

    sed -i '/extern "C" void myPrintf(char \*fmt, \.\.\.);/d' *.c
    

    If you want to perform this recursively, you have two options:

    With Bash 4.X

    shopt -s globstar; sed -i '/extern "C" void myPrintf(char \*fmt, \.\.\.);/d' **.c
    

    With find

    find /some/path -type f -name "*.c" -exec sed -i '/extern "C" void myPrintf(char \*fmt, \.\.\.);/d' {} \;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a tool that generates source files, and each generated file has several
I have a small set of source code files for C. I'm trying to
I have written a program which analyzes a project's source code and reports various
For an existing java application (which I do not have the source code) I
I have a C program which calls several functions from different files, and in
Looking in the ASP.NET MVC 2 source code there are several files in the
I have several small open-source projects that I wrote. All my attempts to find
I have several sources of tables with personal data, like this: SOURCE 1 ID,
I have my sources split up in several directories, so for each directory I
I have written some code that makes use of an open source library to

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.