klimi
I know it's possible, I meant you enable it, because photos can make points far better.
I am afraid I cannot follow your demands as this rule is in this group for very long time and for a good reason. Usually programmers write code and get error messages, which both of these objects are text based and therefore we don't see the need for photos.
Матin Salehizade
I was actually trynna suggest you the condition
Finally got it. With do while loop plus recursive function.
Матin Salehizade
I was actually trynna suggest you the condition
I was think of goto, but goto is not a good solution, instead recursive func works pretty well.
Arvin
congratulation
𝑴𝒂𝒅𝒂𝒍𝒊𝒏
Hey, can I send a picture? It's about technology.
𝑴𝒂𝒅𝒂𝒍𝒊𝒏
About a bug in Chat GPT. 😂
David
Anyone who has come across fflush() in c programming??
David
klimi
What does it do?
what does manual tell you?
David
clears input from the Keyboard
klimi
clears input from the Keyboard
which part? https://en.cppreference.com/w/c/io/fflush
David
oh really?
Yaah am also doubting,,
Stefano
clears input from the Keyboard
It "flush" the input, meaning that it terminate the i/o eventually doing flushing everything to disk.
Матin Salehizade
I want to produce random 10 digit number, but it's faulty : 1000000000 + rand() % 10000000000 Every time gives the same number. What's the problem ?
klimi
Thanks Klimi
you haven't read that before asking the question? just why....
klimi
I want to produce random 10 digit number, but it's faulty : 1000000000 + rand() % 10000000000 Every time gives the same number. What's the problem ?
rand provides on most systems 0 to 2147483647, so if you mod it with 10000000000 you will just get the number. another mistake from your site might be not setting seed (like you have probably read in the reference sheet)
Sara
how can I create an array file, after fopen, to be encrypted later with the decrypt function of the caesar cipher?
Sarib
Hey
Sara
Hello Lumen! I'm trying to write a Caesar cipher in C with the encryption and decryption part ... but when I write the message (to be encrypted or decrypted) in terminal , I would like it to be saved in a file generated as an array of characters ... the which then the function can both read and write this array.. the problem is that i don't know how to write it
Sara
The Cipher examines a string of 94 elements of the ASCII tab and encodes or decrypts the message according to the number (int) of steps that I tell it ... (example ) string :hello step : 2 char --->jgnnq
Sara
yes
Sarib
Any one help me to learn c
lumen
yes
And store the encrypted text in a file thereafter?
Sara
yes
lumen
yes
Why don't you show your code
Sara
whic part?
lumen
whic part?
where you read and encrypt
Chat Boss
Sara sent a code, it has been re-uploaded as a file
Sara
encryption
Chat Boss
Sara sent a code, it has been re-uploaded as a file
Sara
decryption
lumen
encryption
To read the message from terminal, read about command line arguments in C. To store the encrypted text in a file and reading the contents of a file , read about file handling.
Sara
yes i knov but i don't know how can i create,after fopen, that array
Stefano
Can you help me please, what operation should I do with signed values? for example size s = 4; int8_t data[s] {-120,-127,0,0}; int32_t result; for(int i = 0; i < s; i++){ result |= (data[i] >> i*8); }
If you still need it, here is the fixed code: // int s = 4; int8_t data[4] = {-120,-127,0,0}; int32_t result,temp1; result = 0; for(int i=3; i>=0; i--) { result = result << 8; temp1 = data[i]; temp1 = temp1 & 0xFF; result |= temp1; }
ISLAM
write a simple C program to generate, print and count all strings whose characters are from your name. Send to me your program and results. For example, your program should generate "a","b","aa","ab","ba","aab","aba","baa" if your name is "aba".
ISLAM
Please help
ISLAM
Could you help me to the code for that?
ISLAM
if i wanna use my name there as Bulbul
Chat Boss
Could you help me to the code for that?
lumen sent a code, it has been re-uploaded as a file
lumen
lumen sent a code, it has been re-uploaded as a file
the function I have written will generate the strings as per your problem, not filtering the duplicates though.
klimi
Then you need to make one
Chat Boss
Suraj Kumar sent a code, it has been re-uploaded as a file
Suraj
Suraj Kumar sent a code, it has been re-uploaded as a file
in this code some bugs can you help me find the mistake
klimi
in this code some bugs can you help me find the mistake
at least say what the bugs are or what you are expecting and what you are instead getting
klimi
in this code some bugs can you help me find the mistake
line 27 is wrong, you are assigning in if instead of comparing (for more info see the compiler warning)
Suraj
at least say what the bugs are or what you are expecting and what you are instead getting
after the running this code only showing the user name only no extra like email ,contact.
klimi
in this code some bugs can you help me find the mistake
take input function doesn't seem to be loading anything to the memory and it is possibly writing to restricted area
Suraj
wait i give you screenshots
klimi
after the running this code only showing the user name only no extra like email ,contact.
I am quite puzzled that it prints anything, cannot find the place where username would be printed
klimi
in this code some bugs can you help me find the mistake
line 57,59,61,63 you have the same error (as i previvously said abotu the takeinput function, it's just wrong) you cannot take string literal and convert it to char* (again, look at the warnings)
klimi
@andriiko489 : When running the function starting on line 40, the error "stack around variable was corrupted" occurs. How to fix it? Code P.S To start the function press 3.
DaySandBox
Item pastebin.com has been added to list domain-whitelist
Noela
😉😐,
Anonymous
Hello, can i get some c++ tutos
klimi
:)
Go through all the rules and the links mentioned in this post. Contravening the rules laid out here will result in a warning (least likely) or a ban (most likely). This group is meant only for C/C++ discussion. For chitchat of any other kind, go to the Offtopic chat, where anything unrelated to C/C++ programming can be discussed subject to the rules laid out for that group. For information on learning C/C++, see our list of resources at @Resources RULES: 1. Only English language is allowed. If you don't speak English, then this group is not for you. Please look elsewhere. 2. This group is meant to be used for C/C++ discussions alone. Assembly language discussions are allowed as well. The moderators' intention is to keep this group clean and to stick to the purpose the group was created for. Hence, questions or discussions about anything else is strictly forbidden. This further means that: • You should not send useless messages like "Hi"/"Hello", "I'm new here" and similar. • You should not send useless messages like "Does anyone know XYZ?", "Has anyone used XYZ?". Just ask your question directly. • You should not ask questions without checking your problem in Google or any other search engine. Doing so will result in a warning. Following this, check the Resources section of this group to see if your question has an answer there. • You should not ask exams/homework/interviews solutions. This will get you banned. Asking for something that is there in the pinned message right after joining will get you banned. 3. NSFW content (porn, nudity etc) is not allowed. 4. Religion, politics and ideological topics are forbidden. 5. A little bit of programming related jokes and memes are allowed subject to admin group's discretion. 6. Advertisements of any kind are forbidden. Job postings will not be allowed either. If you are unsure about whether something could be construed as an advertisement, please check with one of the admins before posting the message. Not doing so will result in a ban. 7. Code sharing is encouraged subject to the following rules: • Try to use markdown formatting. • For many lines (10+) of code, use a pasting service like Gist, Pastebin, Ubuntu Paste, Hastebin. Don't post walls of code in the chat window. Firstly, it inconveniences others and secondly, you are unlikely to get a response and may even get warned or banned. • Don't attach photos or videos of your screen. Screenshot captures are ok. 8. No illegal activity. This also means no piracy, no requesting/offering hacking/no posting of compiled executables. This will result in an immediate ban. 9. Respect people's privacy. Don't send private messages to people in this group without taking their permission to do so. Not following this rule will result in an immediate ban. 10. Avoid usernames that affects chat readability. The group bot Rose offers a lot of readymade responses that can be used when replying to someone. The most commonly used ones are: • #paste - Display a list of sites where code can be shared. • #markdown - Learn how to use markdown formatting. • #res - Post the link to the C/C++ resource collection. • #meta - Tell someone to get to the point! • #howtoask - Tell someone how they should ask a question. • #ot - Tell someone that their question is off-topic and hence must be moved to the OT group.
why is C Primer Plus by Stephen Prata not recommended?
Jose
why is C Primer Plus by Stephen Prata not recommended?
https://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list Of course it is! There is at the beggining stage
Anonymous
why is C Primer Plus by Stephen Prata not recommended?
It is the C++ book that is not recommended. Even the earlier editions of his C Primer Plus were considered bad. But with the 5th edition of C Primer Plus, it has been moved back into the recommended list. But the books in the Resources list are recommended instead and all of those are better than Stephen Prata's book.
touhou
Hey, can I send a picture? It's about technology.
You're free to send on the C/C++ offtopic group.
Trey
Hello everyone! I started lurn my first IT language - c++ could you give me some advice, maybe what I need to watch/lurn
A7mad⁸⁵
Guys what is the best source to learn C have you tried?
B;
What assignment
klimi
read the rules
Danial
Hi everyone I need some videos or sources (more videos actually ) about learning C++ Can you guys please help me to find out those
Danial
read pinned message
Sorry I understand
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
hi guys, I have a problem with Signal management. I have this client server application, and whenever the client is in input mode (read: the client code is expecting some sort of input from the user via fgets), the CTRL+C command won't work. I obviously created an handler for SIGINT, that is, SIGINT_HANDLER, which deals the disconnection to the server, which will do many things and so on. Problem is, while client code is in fgets loop, if the user presses CTRL+C, nothing will happen. The code will just go on, but if i try to give any input and then press ENTER to send it to the server, it won't work. Shortly, while in fgets loop, the Client won't allow me to shut the code down, but either won't allow me to send any data, therefore both the client and the server thread that handles the client are stuck in this uncomfortable situation. How can I avoid it? Just to be clear, I am using SIGNAL and not sigaction because my prof didn't explain sigaction very much and I'm short on time, but maybe this could be the problem?
Anonymous
hi guys, I have a problem with Signal management. I have this client server application, and whenever the client is in input mode (read: the client code is expecting some sort of input from the user via fgets), the CTRL+C command won't work. I obviously created an handler for SIGINT, that is, SIGINT_HANDLER, which deals the disconnection to the server, which will do many things and so on. Problem is, while client code is in fgets loop, if the user presses CTRL+C, nothing will happen. The code will just go on, but if i try to give any input and then press ENTER to send it to the server, it won't work. Shortly, while in fgets loop, the Client won't allow me to shut the code down, but either won't allow me to send any data, therefore both the client and the server thread that handles the client are stuck in this uncomfortable situation. How can I avoid it? Just to be clear, I am using SIGNAL and not sigaction because my prof didn't explain sigaction very much and I'm short on time, but maybe this could be the problem?
The solution to this problem lies in the way you have implemented your client/server applications. It is important, when receiving input from a user through fgets, to also have an extra check for the signal that is being handled for SIGINT. As such, you will need to create an additional if statement where you can handle cases that involve pressing CTRL+C and other signal interactions. This will allow your application to both receive user inputs while also giving them their desired output, even if they are only partially done with their input command or action. Additionally, it is important to consider using sigaction rather than SIGNAL in order to ensure higher signal handling reliability within your application.