Harsh
If you want to write at end, open at end
Surge.rs
If you want to write at end, open at end
But before operations on file
Anonymous
Thanks ✨
Harsh
If you want a complex example, checkout my school project on file handling: https://github.com/infinity-plus/School_Project
Harsh
N.B
Harsh
It's not good
Suggest then
Surge.rs
(someone offers help by giving example) its bad
Surge.rs
like wut
olli
(someone offers help by giving example) its bad
well, it's hard to get rid of bad practices and habits especially if you learn them from the beginning
olli
very true
hence, I don't think "It's not good" was related to sharing the project but rather to the quality of the code
Surge.rs
hence, I don't think "It's not good" was related to sharing the project but rather to the quality of the code
i didnt look at the code, but sometimes seeing an example of something you are trying to use is extremely beneficial
Surge.rs
just thought it was funny that an example given for file I/O was thwarted away cause its bad
olli
but especially when it comes to IO it's crucial to know what you're doing
olli
otherwise things like heartbleed occur
Surge.rs
Surge.rs
he gave an example of how he was using those operations on a larger scale
Anonymous
It's a good example because his code contains a lot of bad practices
Anonymous
1. The whole code placed in the ONE file
Surge.rs
I didnt say it wasnt good practice. I said it's an example of using files
Anonymous
2. He uses std::cout and std::cin directly
Anonymous
3. The logic and the input tied to each other
Anonymous
I didnt say it wasnt good practice. I said it's an example of using files
When you're beginner, it's hard to distinguish whether the code is good or bad
Anonymous
http://www.cplusplus.com/doc/tutorial/files/
A
We can create one
Please create group for java
William
Can someone help me on how to write a cpp function that combines addition,subtraction and multiplication
Anonymous
What is the error in the (for)?
I_Interface
What is the error in the (for)?
i < 10, not i <= 10 0 1 2 3 4 5 6 7 8 9 = 10 elements
MᏫᎻᎯᎷᎷᎬᎠ
[C++20] Library: mutable constexpr expression for clang 9.0 and gcc 9.1 Hi there! I've just published a weird c++ library targeting clang 9.0 and gcc 9.1. It implements value/type changing constexpr expressions using new c++20 features. Here's an example: ```c++ auto c = unconstexpr::meta_value{}; static_assert(++c == 1); static_assert(++c == 2); c << []{ return "hello"sv; }; static_assert(*c == "hello"sv); static_assert(std::is_same_v<decltype(*c), std::string_view>); ``` If you're a godbolt fanatic like me you can test the above [here](https://godbolt.org/z/mUZwEy) or use the project in godbolt directly by including: ```c++ #include <https://raw.githubusercontent.com/DaemonSnake/unconstexpr-cpp20/godbolt/godbolt.hpp> ``` If you like meta-programming, template, weird off-putting hacks, headaches it is just for you. You can find it here [Github link](https://github.com/DaemonSnake/unconstexpr-cpp20) Thanks for your attention! https://redd.it/e99enu @r_cpp
Anonymous
hello?
Tom
Words with Length N The program must accept a  space separated string S and an integer N as the input. The program must print the words from S which are of length N as the output. If no word is of length N then the program must print -1 as the output. Boundary Condition(s): 1 <= Length of S <= 1000 Example Input/Output 1: Input: Have a good day 4 Output: Have good Example Input/Output 2: Input: help the need 2 Output: -1
Tom
See this
Tom
The output is empty for this input..can anyone pls chk
Ilya
The output is empty for this input..can anyone pls chk
Read something about scanf first, prior to using it
Tom
I tried ==1 also
Ilya
The output is empty for this input..can anyone pls chk
https://en.cppreference.com/w/cpp/io/c/fscanf
Ilya
I tried ==1 also
You can't do accidental programming with C++ or C, must learn first
Ilya
The output is empty for this input..can anyone pls chk
The rest of the code is also a pice of rave.
Tom
It will not work
Y..it is working for small strings 😏
Ilya
Y..it is working for small strings 😏
No it's completely wrong
pratheep
2*std:: getline and concatenate
What can be used in c ??
Поліна
Hi everyone! Have anyone used gRPC with serialization library other that protobuf? I would like to talk about some details, so please text me :) I saw example for Java (gRPC+Gson), but it is super language-specific
MengShu
According to the C standard before C99, you need to declare i at the beginning. With C99 and C++, your original code can be compiled.
Anonymous
What is the error in the (for)?
declare the i first because this declaration works in the new compilers
Anonymous
What is the error in the (for)?
In C language i cannot be declared in the for loop
Anonymous
Anonymous
Mat
?
Anonymous
fichier.cpp but cant open
Mat
fichier.cpp but cant open
Don't share files but pastebin links
Crush_my_love
qwabs
Welcome Qwabhina! Please read the pinned message 🙂 👍👍👍
qwabs
yes
👍
Body
Body
I should transfer it to int array how can i do it?
klimi
just input it into array
Surge.rs
all char's are integers
Body
all char's are integers
When i try to get integers by scanf("%d"), my code doesn't work. Because there is a symbol 's'
András
Yes
Becouse 's' isn't in decimal number system
András
all char's are integers
Well yes but actually no. Ofc it is stored as a 1-byte number, but when you start work with streams a lot of changes
Surge.rs
Body
Becouse 's' isn't in decimal number system
Ok, so what should i do to transfer 's' to integer. I don't know how to implement my idea in code
Body
Read as char
Further i should work with code by integers in matrix.
Body
And output is in integers
András
So, which number in decimal system 's' represents?
Benedetto Califfo