Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
fgets() and scanf() can both limit the length of the string being read:
fgets has a buffer length argument and scanf() can specify length in the format string i.e. "%10s". gets() provides no such length checking.
Why use unsafe functions when safe alternatives exist?
Regards,
Jay
Hi Nick,
You could try this:
int len = strlen(string);
if (string[len-1]=='\n')
string[len-1]='\0'
That should replace a trailing space in 'string' with a null-terminator.[/code]
c - scanf does not capture whitespace
The third argument to fgets() specifies where to read the input -- can be a file or, as I wrote above, stdin (reading console input from the keyboard).
See https://en.wikipedia.org/wiki/Fgets
string with white space reading
gets() will work, but is dangerous because is does not perform bounds-checking. A user can type a string longer than your buffer and overflow it. fgets() is much safer.
scanf c white space bar
Hi Nick,
Instead of using scanf to read input, try:
fgets(buffer, buffer_length, stdin);
This will read a line from the standard input until either a /n character is read, or buffer_length number of characters have been read. The /n character will be copied into the...
pic18f2550 usb hid oscilloscope
Jan Axelson's website has a wealth of USB information:
**broken link removed**
Her USB books are also very informative.
For Windows driver development you will need the Windows Driver Kit:
**broken link removed**
What is your application? Many devices can...
physical meaning of the fourier transform
Analog Devices has "The Scientist & Engineer's Guide to Digital Signal Processing" on their site here: https://www.analog.com/processors/learning/training/dsp_book_index.html.
The chapter on convolution can be accessed here: **broken link removed**...
Re: filter designing
>> active or passive?
passive filters use only passive components (resistors, capacitors, ...)
active filters also use transistors or op-amps
>> order of filter
the higher the filter order, the steeper the transition from passband to stopband will be. also, the higher the...
This excellent article from avrfreaks.net explains the different clock sources you may use with an AVR, how to set them up and what fuse bits to set.
**broken link removed**
hi barada,
PhysioNet, www.physionet.org, may have what you are looking for. They have databases of many physiological signals and open-source analysis tools. Here is a PhysioNet link containing cardiac imaging samples: https://www.physionet.org/physiobank/database/images/
-jay
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.