Scanf is slow big time no?

|
Mr_Smart_Coder 2022-07-30 09:58:46
https://t.me/+XKakbf8Ar3YzMDgy

|Mr.Smart|Personal|Portfolio|Telegram
Full Stack & Android Developer |
=====================
My Personal Profile: @Muhammad_Ali_Mahmudov
——
My Link: @Mr_Smart_Coder
My Bot Liknk: @Mr_Smart_Bot
My Group Link: @Mr_Smart_Group
——
My Portfolio Web-Site: https://mr-muhammadali.netlify.app
alexmb7 2022-07-30 10:08:23
i wanted to start learning and coding .c again
but i dunno the many types etc
and i hate the texts around like guide this and shitt that
alexmb7 2022-07-30 10:08:40
say i wanna do a small awk
alexmb7 2022-07-30 10:08:57
that is vars and strings and functions
alexmb7 2022-07-30 10:10:14
i have big probs with memory alloc
i wanna imolent exact len string assignments ( as practically every str is known len ( not before but at def ) ) and i dunno at all to do this in .c
alexmb7 2022-07-30 10:12:14
i long years ago did some scanner
but i didnt know back then about ‘volatile’ that i can with it define variable len array as like set by user
alexmb7 2022-07-30 10:12:18
i dunno many things
smol_mazunki 2022-07-30 10:12:39
alexmb7 2022-07-30 10:08:23
i wanted to start learning and coding .c again
but i dunno the many types etc
and i hate the texts around like guide this and shitt that

i can help you with c if you want

smol_mazunki 2022-07-30 10:13:06
alexmb7 2022-07-30 10:10:14
i have big probs with memory alloc
i wanna imolent exact len string assignments ( as practically every str is known len ( not before but at def ) ) and i dunno at all to do this in .c

yeah malloc 5*sizeof(char)

alexmb7 2022-07-30 10:13:06
yea hum big time
smol_mazunki 2022-07-30 10:13:14
+1
alexmb7 2022-07-30 10:13:21
if we can reach some average level of comm
alexmb7 2022-07-30 10:13:34
smol_mazunki 2022-07-30 10:13:06
yeah malloc 5*sizeof(char)

i see

alexmb7 2022-07-30 10:13:51
i also need s intact
alexmb7 2022-07-30 10:14:04
so like user data can have s
alexmb7 2022-07-30 10:14:26
cant use default string functions i think, gotta self code or something
alexmb7 2022-07-30 10:14:41
also i need some bignum library for math inf len
smol_mazunki 2022-07-30 10:14:51
alexmb7 2022-07-30 10:13:51
i also need s intact

yeah that’s what i meant by +1

smol_mazunki 2022-07-30 10:15:07
you know about arrays
alexmb7 2022-07-30 10:15:12
a bit
smol_mazunki 2022-07-30 10:15:29
char *my_arr = { ‘h’, ‘e’, ‘l’, ‘l’, ‘o’, ” };
alexmb7 2022-07-30 10:15:34
str = 3 , str = 5
smol_mazunki 2022-07-30 10:15:35
this is an array of chars
smol_mazunki 2022-07-30 10:15:52
chars use ‘, strings use ”
alexmb7 2022-07-30 10:15:57
mate
alexmb7 2022-07-30 10:16:18
smol_mazunki 2022-07-30 10:15:29
char *my_arr = { ‘h’, ‘e’, ‘l’, ‘l’, ‘o’, ” };

can i have this assert at runtime with user runtime data

smol_mazunki 2022-07-30 10:16:43
alexmb7 2022-07-30 10:16:18
can i have this assert at runtime with user runtime data

you can

smol_mazunki 2022-07-30 10:16:54
use scanf to read a string into a var
alexmb7 2022-07-30 10:17:14
im also looking to avoid the ending .. hence i call my system known len strings
alexmb7 2022-07-30 10:17:29
scanf is slow big time no ?
alexmb7 2022-07-30 10:17:35
im looking pure raw speed
alexmb7 2022-07-30 10:17:36
gg
alexmb7 2022-07-30 10:17:50
lemme man scanf
alexmb7 2022-07-30 10:18:23
i dunno
smol_mazunki 2022-07-30 10:18:27
and then compare
for(int c=0; c<length; c++) {
if (my_arr[c] == user_arr[c]) {
fprintf(stderr, “Badn”);
}
}
|