0

I'm writing some code in c, which will be compiled in linux, with gcc -pedantic-errors.

I get the following error:

implicit declaration of function 'sprintf_s'

while my file include

can anyone help in solving this?

here is the code that makes the problem:

#include "chessproj.h"
#include "StringsList.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h> 
#include <time.h>


void add_move_to_list(int fromL, int fromH, int toL, int toH, struct linked_list * list) {
    char possible_move[50];
    char charStartHeight = fromH + 48 + 1;
    char charStartLength = fromL + 96 + 1;
    char charEndHeight = toH + 48 + 1;
    char charEndLength = toL + 96 + 1;
    sprintf_s(possible_move,"<%c,%c> to <%c,%c>", charStartLength, charStartHeight, charEndLength, charEndHeight);
    add_node(list, possible_move, apply_move_and_return_new_game_board(possible_move));
}
vlady
  • 477
  • 1
  • 7
  • 14

0 Answers0