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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:36:27+00:00 2026-06-12T23:36:27+00:00

I need to write a code that will to this: You enter names and

  • 0

I need to write a code that will to this: You enter names and first names and a grade. Only for the grade >= 10, you print the names and firstname of the student with a backward sort.
Exemple:

Bob
Dylan
12

Robert
Patt
9

Chris
Strozy
15

Josh
Sta
11

will give :

Chris Strozy 15 Bob Dylan 12 Josh Sta 11.

My errors are on the strcpy lines :

too few arguments to function ‘strncpy’|
assing argument 1 of ‘strncpy’ makes pointer from integer without a cast

 char tab_nom[N][M] ;
 char tab_prenom[N][M] ;
 float tab_notes[N];
 char tmp_n, tmp_p;
 int i,j,tmp;

for (i=0;i<N;i++)
 {
  printf("Saisissez le nom %d :", i+1);
  scanf("%s",tab_nom[i]);
  printf("Saisissez le prenom %d :", i+1);
  scanf("%s",tab_prenom[i]);
  printf("Saisissez la note %d :", i+1);
  scanf("%f",&tab_notes[i]);
  }

 for (i=0;i<N;i++)
 {
      for(j=0; j< N-1 ; j++)
      {
          if (tab_notes[j] < tab_notes[j+1])
          {
              tmp=tab_notes[j];
              tab_notes[j]=tab_notes[j+1];
              tab_notes[j+1]=tmp;

              strcpy(tmp_n,tab_nom[j]);
              strcpy(tab_nom[j],tab_nom[j+1]);
              strcpy(tab_nom[j+1],tmp_n);

              strcpy(tmp_p,tab_prenom[j]);
              strcpy(tab_prenom[j],tab_prenom[j+1]);
              strcpy(tab_prenom[j+1],tmp_p);

          }
      }
}
  • 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-12T23:36:28+00:00Added an answer on June 12, 2026 at 11:36 pm

    temp_n is a single char. strcpy takes char*

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

Sidebar

Related Questions

I need to write some code that will search and replace whole words in
I need to write some code that will buffer a line to create a
I need to write a javascript program that will ask the user to enter
I need to write some code that would loop though all rows of a
I need to write a C++ code coverage program that takes in another C++
I need to write some code (in any language) to process 10,000 files that
I need to write a delegate function that can 'wrap' some while/try/catch code around
I need to write code to do some realtime processing that is fairly computationally
I'm trying to write a piece of code that will do the following: Take
I need to write a script that will prompt a database user in SQL+

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.