Home > undefined assuming > c error c4013

C Error C4013

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn printf undefined; assuming extern returning int more about Stack Overflow the company Business Learn more about hiring developers or

C4013: 'printf' Undefined; Assuming Extern Returning Int

posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community

Extern In C

Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Warning: C4013 in C lang up vote 0 down vote favorite #include #include void prints(char *menu) { int p = 0; p = navigation(p, menu); } int navigation(int p, char *menu) { return p; } void main(void) { char *menu[] = {"data", "coming", "here"}; prints(*menu); printf("\n"); } How can i fix this the warning is: Warning 1 warning C4013: 'navigation' undefined; assuming extern returning int i:*\testingzone\index.c 9 c visual-studio-2010 share|improve this question asked Jul 22 '10 at 21:31 ScReYm0 751310 1 In some languages (python, PHP, JavaScript, others) you can declare functions which call other functions that aren't defined yet, and all that matters is if the function is declared by the time you call the function that calls it... if you see what I mean. C isn't like that. –Cole Jul 22 '10 at 21:35 add a comment| 5 Answers 5 active oldest votes up vote 2 down vote Along with the other suggestions you've received to declare the function, in this case you can just rearrange the function definitions: #include #include int navigation(int p, char *menu) { return p; } void prints(char *menu) { int p = 0; p = navigation(p, menu); } int main(void) { char *menu[] = {"data", "coming", "here"}; prints(*menu); printf("\n"); return 0; } This isn't always possible though. In particular, you need to use a declaration when/if you have mutually recursive functions (A calls B and B also calls A). I've also fixed the undefined behavior from defining the wrong return type from main. share|improve this answer answered Jul 22 '10 at 21:48 Jerry Coffin 319k31351743 add a comment| up vote 1 down vote Declare functions before calling

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Compiler gives - warning C4013: 'getche' undefined; assuming extern returning http://stackoverflow.com/questions/3313671/warning-c4013-in-c-lang int up vote -4 down vote favorite I'm using Visual studio for my code development and when I used the function getche() The compiler gave me this warning warning C4013: 'getche' undefined; assuming extern returning int But the getche() function is working just as expected , why compiler is showing such a warning , and How can I eliminate this warning? c getch share|improve this question edited Jan http://stackoverflow.com/questions/28170800/compiler-gives-warning-c4013-getche-undefined-assuming-extern-returning-in 27 '15 at 13:06 unwind 253k38330460 asked Jan 27 '15 at 12:42 Sorcrer 983515 2 Include conio.h. –Sadiq Jan 27 '15 at 12:44 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote accepted As your compiler is telling you, getche has not been defined. Usually, you would include a header (e.g. #include ) that will define the function somewhat similar to: int getche(void); There is a rule for the C language that allows usage of functions which have not been defined before. These functions are assumed to take the exact argument types they are passed (none, so void) and return int. Due to this feature (which is evilâ„¢) and the fact that getche does indeed get linked in due to your linker settings, your program actually works correctly. Be aware that getche is deprecated and you should use _getche instead. share|improve this answer answered Jan 27 '15 at 12:48 gha.st 8,16112046 Thanks , that solved the issue (by the way in windows we have to us _getche(); –Sorcrer Jan 27 '15 at 12:59 add a comment| up vote 1 down vote One small thing that I want to add: correcting such errors are non-triv

Programming Boards C Programming warning C4013...errrrrr! Getting started with C or C++ | C Tutorial | C++ Tutorial | C http://cboard.cprogramming.com/c-programming/100619-warning-c4013-errrrrr.html and C++ FAQ | Get a compiler | Fixes for common problems Thread: warning C4013...errrrrr! Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 03-20-2008 #1 IndioDoido View Profile View Forum Posts Visit Homepage Registered User Join Date Apr 2007 Posts 194 warning C4013...errrrrr! hi! warning undefined; assuming C4013: 'printf' undefined; assuming extern returning int warning C4013: 'gets' undefined; assuming extern returning int i'm getting tierd of seeing these warnings, can anyone help me? here's the code where the warnings link to... Code: #include "medico.h" #include "estruturas.h" Medico inserirMedico() { Medico temp; int i; printf("\nNome: "); //<-- warning C4013 gets(temp.nome); //<-- warning C4013 printf("\nMorada: "); //<-- warning C4013 gets(temp.morada); undefined; assuming extern //<-- warning C4013 printf("\nContacto: "); //<-- warning C4013 gets(temp.contacto); //<-- warning C4013 printf("\nEspecialidade: "); //<-- warning C4013 gets(temp.especialidade); //<-- warning C4013 printf("\nID de Medico: "); //<-- warning C4013 gets(temp.idMedico); //<-- warning C4013 temp.numPacientes = 0; return temp; } "Artificial Intelligence usually beats natural stupidity." 03-20-2008 #2 Dino View Profile View Forum Posts Jack of many languages Join Date Nov 2007 Location Katy, Texas Posts 2,309 #include Mac and Windows cross platform programmer. Ruby lover. Quote of the Day 12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong. Amen brother! 03-20-2008 #3 IndioDoido View Profile View Forum Posts Visit Homepage Registered User Join Date Apr 2007 Posts 194 hi todd... Now i get 16 warnings: warning C4047: 'function' : 'const char *' differs in levels of indirection from 'char' warning C4024: 'gets' : different types for formal and actual parameter 1 Code: for(i=0; i<5; i++) { if(i==0) { printf("\nHorario para Segunda-Feira: "); gets(temp.horarioTrab[i].hora); //<------ temp.horarioTrab[i].dia = 2; } if(i==1) { printf("\nHorario para Terca-Feira: "); gets(temp.

 

Related content

error c4013

Error C table id toc tbody tr td div id toctitle Contents div ul li a href Error C a li li a href C printf Undefined Assuming Extern Returning Int a li ul td tr tbody table p resources Windows Server resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine relatedl Forums Blogs Channel Documentation APIs and reference Dev visual studio warning c centers Retired content Samples We re sorry The content you requested has been p h id Error C p removed You ll be auto redirected in

error c4013 visual studio

Error C Visual Studio table id toc tbody tr td div id toctitle Contents div ul li a href Extern In C a li ul td tr tbody table p resources Windows Server resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs relatedl Channel Documentation APIs and reference Dev centers Retired printf undefined assuming extern returning int content Samples We re sorry The content you requested has been removed You ll be c printf undefined assuming extern returning int auto redirected in second C C Building Reference C