Category : scanf

So in c programming language it’s show me a hint and i don’t know what this hint mean #include <stdio.h> int main() { // Initializing: char userName[12]; int userDOB; // Developing: printf("————————————————————-n"); // Taking the userName: printf("PLEASE ENTER YOUR USER-NAME:"); scanf("%s", userName); // Taking the userDOB: printf("PLEASE ENTER YOUR USER-DOB:"); scanf("%i", &userDOB); printf("————————–n"); // Printing ..

Read more

I’m having an issue with Arduino ESP8266 and the sscanf function. I’m trying to parse a 64 bit integer from the string I received from the serial port like this: int64_t temp_freq = 0; sscanf(buffer, "FOUT = %lld Hzrn", &temp_freq); I know I got the right string from the serial port, since my code which ..

Read more

I have a byte* of payload, which is received from the server. I wanna decode it, to get the int inside, so I do this: void myCallback(char *topic, byte *payload, unsigned int length){ Serial.print("Data: "); for (int i = 0; i < length; i++) { Serial.print((char)payload[i]); } Serial.println(); uint32_t i; payload[length+1] = ‘{$content}’; //Payload is ..

Read more

#include <stdio.h> #include <stdlib.h> int main(void) { char first_name[10]; char last_name[10]; printf("What is your first name? >"); scanf_s("%sn", &first_name); printf("What is your last name? >"); scanf_s("%sn", &last_name); printf("Hello and welcome %s %s!n", first_name, last_name); return 0; } If I try run this program with Ctrl+F5, I am able to enter my first name, for example ..

Read more

I have no idea what is happening In my C++ program I wanted to simply read some parameters from the command line. variables are defined at beginning of main(): uint32_t sampling_frequency; uint32_t samples_per_pixel; uint32_t total_samples; uint16_t amplification; after some verification of argc, I’m reading them: sscanf(argv[3], "%" PRIu32, &sampling_frequency); sscanf(argv[4], "%" PRIu32, &samples_per_pixel); sscanf(argv[5], "%" ..

Read more