I_Interface
Anonymous
Anonymous
#cbook
A wrong one, again
I_Interface
கௌரிசங்கர்
😳
Larry
Dima
Larry
try to write it
I've tried many codes which haven't worked and I am just learning...I am not really good at it for know
Lionel
Hello. I have a file that I have to encrypt and decrypt in C. What is the best and secured method to implement an algorithm for encryption and decryption. Any suggestions
Lionel
?
klimi
Anonymous
lol
Lionel
I have a case study on file encryptions and decryptions. And I'm not aware of any methods
Anonymous
Anonymous
Anonymous
you should look for libraries to do that
Lionel
only ascii methods are given. I'm not satisfied with it
Anonymous
look at here: https://en.wikipedia.org/wiki/Blowfish_(cipher)
Anonymous
you have other methods too
Anonymous
you have more options too. You should research which one is the best for you
Lionel
Anonymous
https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
Lionel
thanks again👍🏻
Anonymous
I used to use OpenSSL some time ago when I was working on secure communications
Augmented
hi friends, does someone knows a better way to reverse (reflect) bits order of a simple 8, 16, 32 and 64 bits long variable
Augmented
i have optimised it a little bit, by changing the "for" end condition, from "m" to "d"... now it's faster for variables with smaller value...
Augmented
Israel
https://developer.ibm.com/articles/au-googletestingframework/
Israel
Here you have some interesting links, hopes can help
Ilya
Amir
How to reduce time limit of execution
Anonymous
Augmented
Any ideas how to make this better?
Dima
Larry
Amir
Beside writing good codes. Does input output types effect can be of considerable help ?
Anonymous
Amir
Am i not speaking english ?
Amir
There are Libraries which provides fast input than standard iostream cin. I want to know how much fast it is !
Anonymous
Amir
Standard input is fast enough
I solved a question on codechef. It stated standard input is not fast enough to carry as much as 10^8 inputs and provide output.
MᏫᎻᎯᎷᎷᎬᎠ
Can I capture "move only variable" with lambdas?!
Anonymous
Anonymous
Pavel
Where?
{
res |= m;
}
Yes, and also I would add braces around if. Using braces just make it a bit more protected from errors (and also if there are no braces, the reader needs to check that there are no error).
Also, you have res and r variables, should they be the same variable? And r declared inside the loop so you can't return it like that.
Probably you need to write a test for it. I think it won't compile as it is now
Augmented
MᏫᎻᎯᎷᎷᎬᎠ
Pavel
Still it looks like it won't compile because r is declared inside the for
Augmented
i don't know will the compiler calculate the mask m as constant, i don't don't want shift and multiply to be done in runtime
Augmented
yes, i will pull it on top
Augmented
Pavel
Augmented
before, i had
if (!d)
return r;
inside the loop
Augmented
and the loop end condition was m, not d... but i decided it will be slighlty faster, if iterations are limited, if there is no more 1 bits in the data to shift...
olli
if you want the fastest possible solution use a lookup table
バレンタインがいない柴(食用不可)
Hey guys
What is the suggestion for me that I can employ for ensuring my program not throwing any exceptions? (Consider I’m actually writing a service)
バレンタインがいない柴(食用不可)
I’m actually from a java background and everyone would throw and catch checked exceptions commonly. But in c++ not mindfully catching an exception is really an issue. But if not to use Exception totally then we’ll end up creating a lot of bool functions/methods because we’ll have to have a bool to indicate the successful/failing result, which appears not elegant...
バレンタインがいない柴(食用不可)
Thanks!
Khan
#include <stdio.h>
void main(){
float score1,score2,score3,score4;
printf("Masukkan 4 nilai float: \n");
scanf_s("%f",&score1);
scanf_s("%f",&score2);
scanf_s("%f",&score3);
scanf_s("%f",&score4);
printf("Skor dalam urutan terbalik adalah sebagaimana berikut: \n");
printf("%.2f\n",score4);
printf("%.2f\n",score3);
printf("%.2f\n",score2);
printf("%.2f\n",score1);
}
Khan
why i can't run with scanf_s?
バレンタインがいない柴(食用不可)
#include <stdio.h>
void main(){
float score1,score2,score3,score4;
printf("Masukkan 4 nilai float: \n");
scanf_s("%f",&score1);
scanf_s("%f",&score2);
scanf_s("%f",&score3);
scanf_s("%f",&score4);
printf("Skor dalam urutan terbalik adalah sebagaimana berikut: \n");
printf("%.2f\n",score4);
printf("%.2f\n",score3);
printf("%.2f\n",score2);
printf("%.2f\n",score1);
}
First of all: What’s the error message 😅
バレンタインがいない柴(食用不可)
https://stackoverflow.com/questions/21434735/difference-between-scanf-and-scanf-s
Anonymous
Write a C program that read 5 numbers and counts the number of positive numbers and negative numbers.
How many ways in c to write this program?
Jussi
Pavel
Hey guys
What is the suggestion for me that I can employ for ensuring my program not throwing any exceptions? (Consider I’m actually writing a service)
You still can use try-catch like in Java.
But if for some reason you or your team don't want to use exceptions (e.g. that common in gamedev to avoid exceptions), you can achieve this by wrapping all the external libraries calls that can throw in try-catch, and use other error handling strategies in your code, including:
- returning status codes (e.g. bool or enum with statuses)
- returning "special" values (e.g. if your function returns only positive integers you can use negative values to signal about error)
- using custom written assertions for logical errors, usually a macro that writes an error to log and terminates the application (alternatively breaks into debugger or rise a system popup) if its condition not satisfied, and this macro usually being excluded from production builds
Here's a simple example of such assertion code https://github.com/gameraccoon/hide-and-seek/blob/develop/src/Debug/Assert.h
Ilya
Ilya
Ilya
Amir
Ilya
Ilya
Ilya