like this?
Conversation
Notices
-
THE pleroma-tan enjoyer (kirby@waifuism.life)'s status on Monday, 19-Jun-2023 14:44:10 JST THE pleroma-tan enjoyer -
histoire (histoire@pleroma.skyshanty.xyz)'s status on Monday, 19-Jun-2023 14:44:06 JST histoire @kirby
In a char array
https://www.programiz.com/c-programming/c-strings -
THE pleroma-tan enjoyer (kirby@waifuism.life)'s status on Monday, 19-Jun-2023 14:44:07 JST THE pleroma-tan enjoyer @histoire where would i store it
In conversation permalink Machismo repeated this. -
THE pleroma-tan enjoyer (kirby@waifuism.life)'s status on Monday, 19-Jun-2023 14:44:08 JST THE pleroma-tan enjoyer @histoire inside
In conversation permalink -
histoire (histoire@pleroma.skyshanty.xyz)'s status on Monday, 19-Jun-2023 14:44:08 JST histoire @kirby
Why not use getline and store that, then strlen it
It's been a while since I've used C tbhIn conversation permalink -
THE pleroma-tan enjoyer (kirby@waifuism.life)'s status on Monday, 19-Jun-2023 14:44:09 JST THE pleroma-tan enjoyer @histoire this is for input
In conversation permalink -
histoire (histoire@pleroma.skyshanty.xyz)'s status on Monday, 19-Jun-2023 14:44:09 JST histoire @kirby
From inside the program? Or are you passing it inIn conversation permalink -
histoire (histoire@pleroma.skyshanty.xyz)'s status on Monday, 19-Jun-2023 14:44:10 JST histoire @kirby
Why not use strlenIn conversation permalink -
THE pleroma-tan enjoyer (kirby@waifuism.life)'s status on Monday, 19-Jun-2023 18:34:37 JST THE pleroma-tan enjoyer @sysrq @histoire c!!!! I need help In conversation permalink -
احمدابن محمد الخيام (sysrq@freespeechextremist.com)'s status on Monday, 19-Jun-2023 18:34:37 JST احمدابن محمد الخيام @kirby @histoire
so are you trying to get the length of a line from stdin?In conversation permalink -
THE pleroma-tan enjoyer (kirby@waifuism.life)'s status on Monday, 19-Jun-2023 18:34:38 JST THE pleroma-tan enjoyer @histoire cc @sysrq please help me teacher i need help!!!!!!!!!!!!!!!!
In conversation permalink -
احمدابن محمد الخيام (sysrq@freespeechextremist.com)'s status on Monday, 19-Jun-2023 18:34:38 JST احمدابن محمد الخيام @kirby @histoire
oh dear, what's going on, I just woke upIn conversation permalink -
THE pleroma-tan enjoyer (kirby@waifuism.life)'s status on Monday, 19-Jun-2023 18:34:39 JST THE pleroma-tan enjoyer @histoire okay, so we have the length, but i cant make the user type the data twice?
In conversation permalink -
histoire (histoire@pleroma.skyshanty.xyz)'s status on Monday, 19-Jun-2023 18:34:39 JST histoire @kirby
The easiest way would be use another language I thinkIn conversation permalink -
histoire (histoire@pleroma.skyshanty.xyz)'s status on Monday, 19-Jun-2023 18:34:40 JST histoire @kirby
Something like
len = strlen(getline())In conversation permalink -
histoire (histoire@pleroma.skyshanty.xyz)'s status on Monday, 19-Jun-2023 18:34:41 JST histoire @kirby
Could you do strlen before you store it and use that as the length of the arrayIn conversation permalink -
THE pleroma-tan enjoyer (kirby@waifuism.life)'s status on Monday, 19-Jun-2023 18:34:41 JST THE pleroma-tan enjoyer @histoire how would i strlen a string that is copied using an input function?
In conversation permalink -
THE pleroma-tan enjoyer (kirby@waifuism.life)'s status on Monday, 19-Jun-2023 18:34:42 JST THE pleroma-tan enjoyer @histoire of course but i dont want it going outside of the buffer and i cant just realloc a char* because i dont know the length of the string. i wish c was not so static
In conversation permalink
-