Help me sir, please.

/*This is just simple but i cant locate the error! everytime i run this code the printf at last didnt appear! please help.*/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include<stdio.h>
#include<conio.h>

main()

{
     char fname[10],mname[10],lname[10];


 clrscr();

	gotoxy(7,1);textcolor(YELLOW);
	cprintf("YOur first name? ");
	textcolor(RED);
	cscanf("%s",&fname);

	gotoxy(7,2);textcolor(YELLOW);
	cprintf("YOur first name? ");
	textcolor(RED);
	cscanf("%s",&mname);

	gotoxy(7,3);textcolor(YELLOW);
	cprintf("YOur first name? ");
	textcolor(RED);
	cscanf("%s",&lname);


		gotoxy(7,5);textcolor(GREEN);
		cprintf("Welcome %s %s. %s",fname,mname,lname);



 getch();



 }


Last edited on
I'm not really familiar with microsoft-specific stuff, but I'm guessing you just need to add "\n" to the end of the string in the last cprintf-command.
thanks for the reply sir, i will try it! thx
sir! i try ur suggestion but! it doest work! what i gonna do! please help!
According to this MSDN page, cprintf is deprecated and can not be used in the Windows runtime.
http://msdn.microsoft.com/en-us/library/ms235371.aspx

The above MSDN page recommends the use of the C++ conformant _cprintf or _cprintf_s functions. Note that these functions ignore the \n character.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Last edited on
thank u sir! but i didnt get it! im just a newbie? can u explain it easier? hmmm
What part don't you get?

Deprecated means obsolete or not supported any more.
Did you read the Microsoft link?

Use _cprintf instead. That's pretty obvious.

Code tags? Read the link provided.
Last edited on
Topic archived. No new replies allowed.