Kevin
can somebody tell me , what does it mean?
Kevin
basically , in for loop
Kevin
a=b?
Danya🔥
Apna
Kevin
i cant understand a=b meaning here
Kevin
I compiled it already
Kevin
Kevin
Nothing
Can you please elaborate..
Anonymous
Kevin
Kevin
Anonymous
hhh
Anonymous
What matters is thinking
Kevin
Anonymous
In fact, I prefer to be taught how to think rather than how to code
Anonymous
Anonymous
How to think like a programmer
Anonymous
Kevin
Anonymous
Author?
Its actually "think like a programmer" by v.anton spraul
Kevin
Anonymous
Assuming ur familiar with it since ur in this group
Kevin
Anonymous
yeah
Anonymous
Hi guys, I'm writing two softwares, the former a Server program, the latter a Client program in Unix environment (using C). The client program uses a named PIPE (that is, a FIFO) in order to "talk" to the Server program. This one uses the FIFO on the "reading side". The problem is, I think I have to do something with the stdin in order to make every input from the client program go directly into the PIPE, thus for the server program reading it directly from the other edge of the FIFO, am I wrong? I mean, I wrote:
close(0) (which is stdin);
dup(FIFO_fd); (where int FIFO_fd= open(FIFO_NAME, O_RDONLY);
But I don't know if I am doing it correctly. Since I closed the 0 entry in the process descriptor table, the dup operation should "allocate" the duplicated channel (that is, FIFO_fd) to the first available entry in the table, which is the 0. Thus the question: do I really need to do this? Or is it enough to open a FIFO on both Server and Client program and they'll talk automatically?
Thanks!
Hi friend , i sent a message before you , my problem is like you can you help me ?
Kiss my Toes
Anonymous
I want to know if there is a good video that introduces new standards such as C + + 14 and 17
Anonymous
Anonymous
haha
Anonymous
Hi , i am 18 years old and i am learning C and C++ , i want to migrate because in my country because there is no room for improvement.
I wanna continue my programming lessons
What should i do?
And how should i apply?
Anonymous
Did you write this code in a file
Anonymous
just a file not files?
Anonymous
Amrith
Amrith
Anonymous
Anonymous
Hii
Anonymous
Can i get java code for attendance management system?
Anonymous
If I'm not mistaken, here seems to be c
DarkEnergy
Hey guys. cpp newbie here.. a quick question about the vector.end() iterator in the context of vector.insert()
DarkEnergy
class Solution {
public:
void rotate(vector<int>& nums, int k) {
cout << *(nums.end() - k);
nums.insert(nums.begin(), nums.end()-k, nums.end());
}
};
DarkEnergy
for a test case where vector<int> nums = {1,2,3} and k = 1, the above code would change the vector to {2,2,1,3}. why doe the it append “2” to the beginning of the vector, not “3”? ( cout however prints “3” though)
DarkEnergy
I googled around but can’t find the root cause.. any input is appreciated. thanks guys!
Marcio
How to access the OT group?
PHATHUTSHEDZO
Good day everyone
Anyone to help me with explaining thoroughly The C programming function implementation??
Faramarz
typedef struct{
char name[30];
float height;
}person_s;
Hello, Do you know why sizeof this struct is 36 not 40?
Marcio
print sizeof(float) and you will know.
Faramarz
I did it is 36 but shouldn't be a factor of 8 which is 40?
Marcio
It changes from machine to machine. This is the reason many books advice to use sizeof if you are working close to the machine.
Marcio
Maybe the factor is 4, so 32 to the array plus 4 to the float.
Faramarz
Anonymous
first
Anonymous
You need to see what your compiler is
Anonymous
Vs or vscode or something
Anonymous
this involves memory alignment
Anonymous
Anonymous
bc 32 is a multiple of 8🥱
Anonymous
2 4 8 16 32 64
Anonymous
VS I remember the default alignment number is 8
David
1 #include <stdio.h>
2  
3 int numOfDivisors(int n);
4 void storeDivisors(int n,int a[],int *x);
5  
6 int main(){
7     int number;
8     int a[100];
9     int x = 0;
10     int i;
11  
12     // user should input the parameter
13     printf("Enter the paramter(+ interger): ");
14     scanf("%d",&number);
15  
16  
17     storeDivisors(number,a,&x);
18  
19     for(i=0;i<x;i++)
20         printf("%d\n",a[i]);
21     printf("number of divisors = %d\n",x);
22  
23     return 0;
24 }
25  
26 int numOfDivisors(int n){
27     int i, numOfDivisors=0;
28  
29     for(i=1;i<=n;i++)
30     {
31         if(n%i==0)
32         {
33             numOfDivisors++;
34         }
35     }
36     return numOfDivisors;
37 }
38  
39 void storeDivisors(int n,int a[],int *x){
40     int i;
41     for(i=1;i<=n;i++)
42     {
43         if(n%i==0)
44             a[(*x)++]=i;
45     }
46 }
David
so basically i want the divisors to enter a .txt file i created
David
instead of printing in the console
AGEGNEHU
I'm not understand
D
Guys
D
Any one can help me to do this
Anonymous
I think it's output redirection
Anonymous
enter the results into the txt instead of the terminal
Anonymous
Eduardo
Thank you
Libertas
Hey, i have a C question, i have a word that i read from keyboard, and alpfabed as a string. I need to parse the word and to find what index is each letter in alphabet string, so i came with this decision
void *encode(char str[100], char alpha[26], char initialAlpha[26], size_t n) {
int Index;
int stringLength = strlen(str);
for (int i = 0; i < stringLength; i++)
{
for(int j = 0; j < n; j++) {
// printf("%d\n\n", strcmp(str[i], initialAlpha[j]) == 0);
if (strcmp(str[i], initialAlpha[j]) == 0)
{
// str[i] = alpha[j];
printf("%c ", alpha[j]);
}
}
}
printf("%s", str);
}
but it returns nothing to me and shows that str[i] and initialAlpha[j] are char but should be Char *
but when i add & in front of them error dissapear but it isn’t working as it should :c
what should i do?