Notaxmar
M
klimi
Billionaire
%Nikita
You need 2 cycles.
Cycles is a waste of your CPU clocks in this case. Just output strings that stored in .data section
Anonymous
Can some one please loook into it
You are comparing se to variables male and female but you have not defined a value for those variables.
Also change your scanf statement to scanf("%d\n%c",&sal,&se)
Nada
Hey friends
Nada
I'm working on undo redo operations
And I decided to make it by this way
Save each operation and store it in a vector of strings then if user choose to make undo
Hel will load the graph on it
Nada
I tried this by save and load and it works
Nada
But I can't know how to implement it
Nada
As the first step I have to know how to save each operations
Nada
So do you have any suggestions,l?
B;
https://pastebin.com/T83riF9Y
B;
the program works fine and runs as it should but i want it to quit when I enter "quit" as an input, however it only takes integer values as input, if I put anything else it returns an error.
B;
I want it to take both, int as well as char values, can anybody help
B;
/
Anonymous
How to untie cin from cout? I want to make a class which will untie cin in constructor and tie in destructor
𝕰𝖉𝖚𝖆𝖗𝖉𝖔
How can I stop a program when a char has been input, i have a getchar() can't figure out
Dorith
How can I write a module of number |4-5| in c++?
Anonymous
Konstantin
how?
Digits should count down then count up every string. It makes already 2 cycles per string.
But the lowest value of the every string counts down and counts up too. So there should be 2 cycles. One per half of output.
Anonymous
I want it to take both, int as well as char values, can anybody help
You would then have to change your program to read a string as input instead of an int. If the string input is "quit", you exit the program just like you do now when input is 0. If the input is anything else, you first convert it to an int (if the input is neither quit nor an integer, you inform the user and prompt him/her for a valid input again) and then do the rest the way you are currently doing.
Anonymous
How to find a frequency of character in string in c??
Droningbro
Mr
Can some one please loook into it
You have to use char s[n]
Instead of string s, cause cpp complier doesn't know the length of the variable you are passing in, That's why it doesn't set value of s[0], s[1], s[2] etc
Chat Boss
Kartik
I want to implement a memory pool in C++, can anyone tell me different ways to do this?
Kartik
Examples would be very helpful, thanks
Kartik
I am not making any software (just learning about memory pools)
Anonymous
Kartik
Otoniel
First, thank you, this is the first time I hear about memory pool, so I've end up learn it too, first I did some research to understand the concept, and Wikipedia has a clear explanation + implementation instructions, even after that read, wasn't that clear at all, but, then, I found the jobtalle's pool repo on GitHub, it is a memory pool implementation, includes a test you can use to understand how to use the pool yourself, hopefully it will be useful to you Kartik
Anonymous
I want to implement a memory pool in C++, can anyone tell me different ways to do this?
This is a good starting point to understand why we need different memory allocators
https://github.com/mtrebi/memory-allocators
The code however is a straightforward C++ implementation of the concepts.
But be aware that the C++ standard now supports std::allocator, std::allocator_traits and so on which make it somewhat easier to write allocators (but are clunky nevertheless). The C++17 standard made memory allocations slightly more easier with PMR (std::pmr::polymorphic_allocator). This was a welcome change to the one supported in C++11/14.
You can refer to the following talks to understand better:
https://m.youtube.com/watch?v=LIb3L4vKZ7U (Andrei Alexandrescu)
https://m.youtube.com/watch?v=RLezJuqNcEQ (Alistair Meredith)
https://m.youtube.com/watch?v=v3dz-AKOVL8 (Pablo Halpbern)
Kartik
First, thank you, this is the first time I hear about memory pool, so I've end up learn it too, first I did some research to understand the concept, and Wikipedia has a clear explanation + implementation instructions, even after that read, wasn't that clear at all, but, then, I found the jobtalle's pool repo on GitHub, it is a memory pool implementation, includes a test you can use to understand how to use the pool yourself, hopefully it will be useful to you Kartik
Thanks for the reply
Kartik
Kartik
Will see this repo and what @gaegelys said
Ибраги́м
Monitor your services with:
https://github.com/louislam/uptime-kuma
Katrin
Does anyone know how to create a recursive function that counts prime numbers in array (C language)?
Yegor
what's the problem of this code:
do {
ch = fgetc(file);
printf("%c", ch);
} while (ch != "\0");
file just contain "Hallo, world\n" ?
Ighor
Kartik
Anonymous
Does anyone do project in C?
Anonymous
Management hospital in c
Kartik
Mr
Management hospital in c
Is it like encrypted database where all patients details store there? If not then it's quite easy to do for college projects.
Chat Boss
Anikalp Jaiswal sent a code, it has been re-uploaded as a file
Anonymous
Otoniel
Anonymous
Which c++ ide is more comfortable for beginners?
Anonymous
Can someone explain me, what is COM-Server?
Anonymous
And generally COM
Anonymous
And for what does Windows use it
%Nikita
ch != '\0'
But you should read until EOF character.
stdio.h
#define EOF -1
Anonymous
Anonymous
Maybe 😏
Anonymous
?
Anonymous
%Nikita
And generally COM
As I remember, COM is an old DOS executable file extension. It can be executed in 16 bit mode, idk about 32 and 64 machines. The simpliest .com file ( DOS program ) will look like this:
BITS 16
ORG 100h
start: mov ah, 4ch
int 21h
It's just return
Anonymous
I meant
Anonymous
Component Object Module
Anonymous
👍
/
hi i need help to compile a twrp
0101
Not showing
i dont know why its automatically sent as a file, heres my code..
int main(){
    char str[100];
    int count[256] = {0};
    printf("Enter a string : ");
    fgets(str, sizeof(str), stdin);
    for(int i=0 ;i<strlen(str); i++)
        count[str[i]]++;
    for(int i=0 ;i<256; i++)
    if (count[i] >0) 
        printf("'%c' appears %d times.\n", i, count[i]);
}
Chijioke
Can someone explain how Rand()% MAX
Help to generate random numbers in c.
Chijioke
I know % is to return the remainder. So how does %MAX now give 0 to MAX
klimi
klimi
if you have like number 123 and you divide it by 5, the remainder is 3
Chijioke
Like in my mind, it like
rand() is ≈37000
and MAX=100
then rand()%MAX will now be 0