error LNK2019

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AlexC
    New Member
    • Apr 2010
    • 9

    #1

    error LNK2019

    I have this errors.
    t.obj : error LNK2019: unresolved external symbol _scanf referenced in function _EnQ

    t.exe : fatal error LNK1120: 1 unresolved externals

    any ideas ?
    Code:
    #include <stdio.h>
    #include <string.h>
    
    int n = 0;
    char Q[8];
    int tmp;
    char *H = Q;
    char *T = Q;
    int count = 0;
    
    
    
    int main(){
    	int choice;
    	
    menu:
    	printf("1 EnQ\n 2 DeQ\n 3 Print\n 4 Exit\n");
    	scanf("%d", &choice);
    	switch(choice){
    		case 1:{ 
    			EnQ();
    			goto menu;
    			   }
    Code:
    int EnQ(){
    	if(count == 0){
    		printf("Enter the Char:");
    		scnaf("%c", &Q[n]);
    		n++;
    		count++;
    }	else if(count == 7)
    			printf("The array is full");
    else if(n == 7){
    		n = 0;
    		printf("Enter the char:");
    		scnaf("%c", &Q[n]);
    		count++;
    		T++;
    		n++;
    }else{
    	printf("Enter the char:");
    	scanf("%c", &Q[n]);
    	n++;
    	count++;
    }
    	tmp = n;
    	return 0;
    }
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Are you sure than doesn't read

    t.obj : error LNK2019: unresolved external symbol _scnaf referenced in function _EnQ

    ?

    See lines 4 and 12 of your second listing

    Comment

    • AlexC
      New Member
      • Apr 2010
      • 9

      #3
      I see, thanks. Sorry for stupid question, i could figure it out.

      Comment

      Working...