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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:26:40+00:00 2026-06-13T05:26:40+00:00

I’m writing a program to generate a string of random uppercase letters, then take

  • 0

I’m writing a program to generate a string of random uppercase letters, then take user input of uppercase letters, along with a character form the user. For any instance of the user input letter in the random string, it replaces that letter with the character entered by the user.

For example, s1 = {BDHFKYL} s2 = {YEIGH} c = ‘*’

Output = BD*FK*L

Anyway, I’m getting a conflicting types error at the function declaration under main and I implicit decoration at the function call. Does anyone know why? Thank you in advance.

#include <stdio.h>
#include <stdlib.h>

void fillS1(char x[42]);

void fillS2(char x[22]);

void strfilter(char a[], char b[], char c);

int main(int argc, const char * argv[])
{
char s1[42];
char s2[22];


fillS1(s1);

//printf("%s\n", s1);

puts(s1);

fillS2(s2);

strFilter(s1, s2, '*');  //Implicit declaration here


return 0;
}

void fillS1(char x[])
{
for (int i = 0; i < 40; i++)
    x[i] = 'A' + random() % 26;
x[40] = (char)0;
}

void fillS2(char x[]){

int i = 0;


printf("Please enter at least 2 capital letters and a maximum of 20.\n");
while (( x[i] = getchar()) != '\n' ) {

    i++;

    }

x[i] = '\0';

if (i < 3) {
    printf("You need at least two letters");
}

else if (i > 21){
    printf("You cannot have more than twenty letters");
}

/*else if (((i > 'a')) || ((i < 'z'))){
    printf("You many only have capital letters");
}   */



 else puts(x);
}

void strFilter(char a[], char b[], char c){ //Conflicting types error here
int i = 0;
int n = 0;

while (n < 21) {

    for (i = 0; i < 41; i++) {
        if (a[i] == b[n]){
            c = a[i];
        }
    }
    i = 0;
    n++;
}

puts(a);
}
  • 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-13T05:26:42+00:00Added an answer on June 13, 2026 at 5:26 am

    You have a mismatch in your identifiers: strFilter (with a capital F) is not the same as strfilter (with a lowercase f). So, change your predeclaration from this:

    void strfilter(char a[], char b[], char c);
    

    to this:

    void strFilter(char a[], char b[], char c);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I need to clean up various Word 'smart' characters in user input, including but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
Specifically, suppose I start with the string string =hello \'i am \' me And
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.