shared buffer processes.
I am trying to call functions that are add some characters to the buffer and then remove them after. but am still failing to call the function properly.Am working on Linux sys.

ERROR: q_add makes an interger without a cast.

THis is part of the code:

do {
    printf("Enter shared buffer operation ");
    printf("i(init)/a(add)/r(remove)/t(items)/d(delete)");
    scanf("%c%c", &op, &discard);
    int a;
    char n;
                
    switch ( op )
    {
      case 'i':
               q_add(a, n);
               break;
                	
      case 'a':
               q_delete();
               break;
                
      case 'r':
               break;
       //------------------------------------------------------------------

       //Definition in the apropriate file are as:

     void q_add(int n, char *x)
       {
	shbuf->count += n;
	while ( n-- > 0 )
	 {
		shbuf->buf[shbuf->inspos++] = *x++;
		if ( shbuf->inspos ==  QSIZ )
			shbuf->inspos = 0;
	 }
        }

    //And this function doent really work out.if uncomment the exit, i get an error
   
    void q_delete()
       {
	if ( -1 == shmctl(shmid, IPC_RMID, 0) )
	  {
		perror("Can't remove shared mem");
		//exit(1);
	 }
     }
shared buffer processes.
===

I am trying to call functions that are add some characters to the buffer and then remove them after. but am still failing to call the function properly.Am working on Linux sys.

ERROR: q_add makes an interger without a cast.

THis is part of the code:

do {
    printf("Enter shared buffer operation ");
    printf("i(init)/a(add)/r(remove)/t(items)/d(delete)");
    scanf("%c%c", &op, &discard);
    int a;
    char n;
                
    switch ( op )
    {
      case 'i':
               q_add(a, n);
               break;
                	
      case 'a':
               q_delete();
               break;
                
      case 'r':
               break;
       //------------------------------------------------------------------

       //Definition in the apropriate file are as:

     void q_add(int n, char *x)
       {
	shbuf->count += n;
	while ( n-- > 0 )
	 {
		shbuf->buf[shbuf->inspos++] = *x++;
		if ( shbuf->inspos ==  QSIZ )
			shbuf->inspos = 0;
	 }
        }

    //And this function doent really work out.if uncomment the exit, i get an error
   
    void q_delete()
       {
	if ( -1 == shmctl(shmid, IPC_RMID, 0) )
	  {
		perror("Can't remove shared mem");
		//exit(1);
	 }
     }