arrays and strings in c

558fe5180e0e8fc922d31c23ef84d240

can someone explain to me this code and what the output should look like?, is there going to be two strings? and what does dest[I]=to src[] mean, is string bar going to have the string abcd or efghijk.

#include <stdio.h>

void copy_str(char *dest, const char *src);



int main(void)
{
  char foo[7];
  char bar[7] = {'E', 'F', 'G', 'H', 'I', 'J', 'K'};
  copy_str(bar, "ABCD");
  copy_str(foo, bar);
  return 0;
}


void copy_str(char *dest, const char *src)
{
  int i;
  for (i = 0; src[i] != '\0'; i++)
    dest[i] = src[i];

  // point one 
  dest[i] = '\0';
  return;
}

trying to convert a number of seconds into days, hours, min and seconds

558fe5180e0e8fc922d31c23ef84d240

i been trying trying to convert a number of seconds into days, hours, min and seconds. but i keep getting errors, "expected identifier or '('" . how should i fix it.`

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

void to_dhms(int total_s, int *d, int *h, int *min, int *s);


int main(void)
{
  int seconds_in, days, hours, minutes, seconds, scan_count;

  printf("Enter a number of seconds that is >= 0: ");
  scan_count = scanf("%d", &seconds_in);  
  if (scan_count != 1) 
  {
    printf("Unable to convert your input to an int.\n");
    exit(1);
  }
  if (seconds_in < 0) 
  {
    printf("%d s is out of range!\n", seconds_in);
    exit(1);
  } 

  printf("Doing conversion for input of %d s ... \n", seconds_in);



  result= to_dhms(days, hours, minutes, seconds);
    printf("That is %d day(s), %d hours(s), %d minute(s), %d second(s).\n",
         days, hours, minutes, seconds);

  return 0;


}
void to_dhms(int total_s, int *d, int *h, int *min, int *s);
{
  *d = total_s / 86400;
  remaining= total_s% 86400;
  *h= remaining/ 3600;
  remaningofh= remaining%3600;
  *min= remaningofh/ 60;
  *s =remaningofh % 60;
  return result;

}

`

how to convert a number of seconds into days , hours, minutes and seconds

558fe5180e0e8fc922d31c23ef84d240

hello i want to print convert seconds into days, hours, munite, and seconds but i do not know how to call void into line 28 so it can print.

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

void to_dhms(int total_s, int *d, int *h, int *min, int *s);


int main(void)
{
  int seconds_in, days, hours, minutes, seconds, scan_count;

  printf("Enter a number of seconds that is >= 0: ");
  scan_count = scanf("%d", &seconds_in);  
  if (scan_count != 1) 
  {
    printf("Unable to convert your input to an int.\n");
    exit(1);
  }
  if (seconds_in < 0) 
  {
    printf("%d s is out of range!\n", seconds_in);
    exit(1);
  } 

  printf("Doing conversion for input of %d s ... \n", seconds_in);


  {  
    //how can i call void to_dhms here 
    printf("That is %d day(s), %d hours(s), %d minute(s), %d second(s).\n",
         days, hours, minutes, seconds);

  return 0;
  }

}
void to_dhms(int total_s, int *d, int *h, int *min, int *s);
{
  *d = total_s / 86400;
  remaining= total_s% 86400;
  *h= remaining/ 3600;
  remaningofh= remaining%3600;
  *min= remaningofh/ 60;
  *s =remaningofh % 60;
  return;

}

Converts a number of seconds into days, hours, minutes, and second?.

558fe5180e0e8fc922d31c23ef84d240

i am trying to Convert a number of seconds into days, hours, minutes, and seconds. using pointers but something seems wrong . can somone tell me what is the problem and how to solve it. it keeps telling me
error: function definition is not allowed here

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

void to_dhms(int total_s, int *d, int *h, int *min, int *s);


int main(void)
{
  int seconds_in, days, hours, minutes, seconds, scan_count;

  printf("Enter a number of seconds that is >= 0: ");
  scan_count = scanf("%d", &seconds_in);  
  if (scan_count != 1) 
  {
    printf("Unable to convert your input to an int.\n");
    exit(1);
  }
  if (seconds_in < 0) 
  {
    printf("%d s is out of range!\n", seconds_in);
    exit(1);
  } 

  printf("Doing conversion for input of %d s ... \n", seconds_in);

  int main(void)
  {
    printf("That is %d day(s), %d hours(s), %d minute(s), %d second(s).\n",
         days, hours, minutes, seconds);

  return 0;
  }

}
void to_dhms(int total_s, int *d, int *h, int *min, int *s);
{
  days = seconds_in / 86400;
  seconds = seconds_in % 86400;
  hours=seconds_in / 3600;
  hours= hours %3600;
  minutes= seconds_in / 60;
  minutes= seconds_in %60;
  seconds = seconds_in% 60;

}