0

This is my code,

_tprintf(_T("\nPlease set all fields"));
_tprintf(_T("\n Input Name: "));
_tscanf_s(L"%ls",inputHolder,length);
wcscpy_s(LC.NAME,length, inputHolder); 

the problem is when I am inputting a name with space the program will think that the white space is a enter then it will skip to the next input.For example

( what i want, Input Name: mj stack)

( whats happening, Input Name:mj Category:stack)

Help please, ps I am a noob.

KARTHIK BHAT
  • 1,410
  • 13
  • 23
  • 1
    Welcome to Stack Overflow. Please read the [About] page soon. The `%s` conversion specifier is defined to stop at the first white space. If you want a different meaning, you need to use a different conversion specifier. Maybe you should be reading lines with `fgets()`? Maybe you should be using a scanset such as `%[^\n]` to read the data. It's hard to be sure. – Jonathan Leffler Feb 07 '14 at 06:39
  • @JonathanLeffler I used %ls not %s. afaik %ls stands for long string like %i stands for int. im so confused, anyway thanks for response. – user3282583 Feb 07 '14 at 09:18

0 Answers0