ʙʀʜᴏᴏᴍ ⑇
Thanks a lot
ʙʀʜᴏᴏᴍ ⑇
Trailer park boys
Can c++ do a program that identifies faces as male or female, anyone here ever tried??
Ludovic 'Archivist'
I don't remember if someone here asked for my blogpost on benchmarking but here it is:
https://archivist.nekoit.xyz/correct-benchmarking/
klimi
Ludovic 'Archivist'
Quick reminder of what accuracy means here:
Ludovic 'Archivist'
TP = true positive
TN = true negative
TP + TN + FP + FN = all classification attempts
Trailer park boys
Anonymous
write (1, &c, 1);
Anonymous
char c;
c = 'z';
while (c >= 'a')
{
write (1, &c, 1);
c--;
}
Anonymous
i understand what does it do and how does it work
Anonymous
but could someone explain this part
Anonymous
write (1, &c, 1);
Anonymous
i know that write &c is a reference of the c variable but the number 1 at the start and at the end of the condition ,i didn't understand there meaning
Phil
write(stdout, &c, size 1 byte)
Anonymous
Phil
But I recommend you to write stdout instead of 1 cause that's clear to understand at the first glance, and it is more appropriate
Nitesh Kumar
https://www.programassign.com/?m=1
Anonymous
Anonymous
Phil
Ah
Phil
Let me check so
Anonymous
#include <unistd.h>
#include <stdout.h>
void ft_print_reverse_alphabet(void)
{
char c;
c = 'z';
while (c >= 'a')
{
write (stdout, &c, 1);
c--;
}
}
int main()
{
ft_print_reverse_alphabet();
}
Anonymous
i changed the
Anonymous
#include <stdio.h>
Phil
ok my bad, https://stackoverflow.com/questions/59188184/get-file-descriptor-of-stdout-c according to you can't write write(stdout, &c, 1) due to the fact that stdout is considered as a FILE * but write(int fd, const void *__buf, size_t __n) so if you would like to still write the word stdout you should write something like write(fileno(stdout), &c, 1) wich is not pretty, so yeah my bad to sum up keep writting write(1,&c,1)
PS and yeah you messed up it's not #include <stdout> but #include <stdio.h> (standart Input Output)
@Rida2015
Phil
@Rida2015
If you're allowed to use stdC99 with suckless/BSD style you can rewrote your code snippet like this :
C
void
ft_print_reverse_alphabet(void) {
for( char c='z' ; c >= 'a'; c-- )
write (1, &c, 1);
}
ֆ33ʏ377
any IDE suggestions so i dont have to install packages manually in C++
ֆ33ʏ377
Thanks in advance
Phil
You return 0 if you want to return the number then multiply the pos by the convinent power of ten and sum them all
● Igor
guys
● Igor
any idea how some programs prevent keyboard events propagations?
● Igor
for example: pressing alt + tab on virtualbox won't do anything on my host machine, because virtualbox prevents it to getting to my host machine desktop
● Igor
synergy is another program that does something similar
● Igor
maybe virtualbox uses some complex solution since it is a virtualization software, so maybe synergy is a better example
klimi
if you use x it is quite easy... just use xlib to catch the keycodes and modiify them if necessary. we have used it a little too https://gitlab.fi.muni.cz/unix/noctrl
▪️fateme👷🏻♀️
#include<stdio.h>
struct node {
int data;
struct node* next;
};
int main() {
struct node *newNode;
newNode = malloc(sizeof(struct node));
newNode->data = 4;
struct node *head=newNode;
struct node *temp = head;
for(int i=2; i < 4; i++) {
if(temp->next != NULL) {
temp = temp->next;
}
}
newNode->next = temp->next;
temp->next = newNode;
temp->next=NULL;**
while(temp!=NULL) {
printf("%d",temp->data);
temp=temp->next;
}
I wrote this code and this code has 4 as output
In this code we have
temp->next=newNode;
temp node is referring to newNode
In the next line it is written
temp->next=NULL;
and I used the while loop to print output, the output was for against my expectations
after I had inserted NULL as the next element of temp I was expecting to print nothing, because I had changed the reference of temp->next
So my question is: why it still has 4 as output???
● Igor
Sleeves
learn to diiferentiate ‘1234’ from “1234"
Faramarz
For a problem about designing computer I calculated the clock rate of computer A and computer B, can use them to conclude how much computer A is faster than computer B?
Anonymous
Anonymous
Code in C :
char curr[] = “JJJ”;
I get a syntax error when running a simple line. I do not see the syntax error
Aquatica
Aquatica
"" is different from “”
m
Hi everyone,
I have a use case where my program has really big arrays pre-initialized with values, clang takes a very long time to work on it is there is a way to speed up the process?
m
I am basically implementing a CNN in High level synthesis using Vitis-HLS which uses clang
Ludovic 'Archivist'
Ludovic 'Archivist'
If you need to modify the arrays afterwards during execution, you can map them with MMAP_PRIVATE or whatever the option is that will make them copy on write
Anupam2.7
What is the scope of variable if it is defined outside int main() and def functions?
Anupam2.7
Nir
/
help
/
i need help to place a variable always in a register
/
i tried using volatile register
Anonymous
Please do anyone of you know any group that teach c++ for beginner
Anonymous
Sorry YouTube channel
/
/
Anupam2.7
● Igor
Anonymous
Anonymous
It this []
Anonymous
how to reduce a size stub on c? Compiler Gcc on windows
/
klimi
help me
tldr; you can't. it is up to the compiler to decide (maybe you could write asm code but meh)
Ludovic 'Archivist'
Anonymous
Hello everyone 😊 Are there any YouTube channels and books you recommend that I can use while learning C and C++ languages? Thank you so much 🙏
/
/
tldr; you can't. it is up to the compiler to decide (maybe you could write asm code but meh)
loc_CD84:
mov rax, [rbp+var_28]
add rax, 4
mov [rbp+var_28], rax
mov rax, [rbp+var_28]
mov ecx, [rax]
mov [rbp+var_48], ecx
mov rax, [rbp+var_28]
add rax, 4
mov [rbp+var_28], rax
mov ecx, [rbp+var_48]
mov edi, ecx ; unsigned __int64
call __Znam ; operator new[](ulong)
mov cs:qword_36070, rax
mov rdi, cs:qword_36070 ; char *
mov rsi, [rbp+var_28] ; char *
mov edx, [rbp+var_48] ; unsigned int
call __Z6memcpyPcPKcj ; memcpy(char *,char const*,uint)
jmp loc_CDFD