Chat Boss
Sid Xid sent a code, it has been re-uploaded as a file
Olivia
✅check it as a switch case there are both armstrong and palidrome number
MaaKa
Olivia
okay
Notaxmar
Thank you all @Lory10e20 @Johnn_D0e. Thank you for your help. I have changed accordingly and it has worked
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Anonymous
AC_
Guys does anyone know how to open FullScreen the graphics.h window in ubuntu 18.04?
I tried with initwindow but it doesn't seem to be present in the library
klimi
Roxifλsz 🇱🇹
Ubunut does not proove that he isn't a Wendy's user
Roxifλsz 🇱🇹
Yes.
Roxifλsz 🇱🇹
He wouldn't try to use graphics.h if he wasn't a Wendy's person
klimi
Egro
brain melting.. size() and capacity() member functions
Msec
brain melting.. size() and capacity() member functions
The size() and capacity() functions are two functions available in the C++ STL (Standard Template Library).
The size() function returns the number of elements in a container. For example, if we consider that there are 5 elements in a vector, v.size() will return 5.
The capacity() function returns how much memory is allocated for a container. This is memory reserved to be used for elements in the container. For example, if a vector has a size of 5 but a capacity of 10, the vector has 5 elements but allocates 10 elements in memory.
Egro
ohhh i see, capacity() double the space for the number of elements in a vector
Egro
thanks
Olivia
Msec
Olivia
sir?????????
Olivia
Yash
Okkk
● Igor
FILE *file = fopen(argv[i], "r");
if (file == NULL) {
fprintf(stderr, "%s: %s: %s\n", argv[0], argv[i], strerror(errno));
exit_status = errno;
continue;
}
while (1) {
int ch = getc(file);
if (ch == EOF)
break;
putc(ch, stdout);
}
● Igor
what is the proper way of handling errors during reading and writing to files here?
● Igor
should I check ferror inside the loop? or just after the while
Sara
int fp = open(outputPath,O_WRONLY|O_CREATE|O_TRUNC, S_IRUSR|S_IWUSR|I_IRGRP|S_IROTH);
Albina
I am trying to look for inconsistent data by comparing two files. If the temperature is off by 0.001 , I have to report it. However, while using the bsearch I am confused what my key has to look like
Sara
guys i have a segmentation fault for this line .. why ?
Chat Boss
Albina ✨ sent a code, it has been re-uploaded as a file
Albina
I'm unsure, but it feels like the problem is in the key
Ammar
guys i have a segmentation fault for this line .. why ?
I don't think that call is the cause of segmentation fault. Even if you pass an invalid address in that outputPath, the syscall will just return -EFAULT (not yields a SIGSEGV signal).
That being said, it's somewhere else in your code that causes segfault. Please give more detailed information or send the related code.
\Device\NUL
Sara
outputPath.txt is a /output.txt where the folder "a/" doesn't exist in the cwd ... i think should be create with this code ... but i have this error of sf
\Device\NUL
\Device\NUL
system call is expensive tho, that's why it's fully buffered by default
Egro
pointers.. learning about it
Egro
a pointer is a memory addres of a variable
double *p;
declearing a pointer pointing to a variable of type double.
Egro
c++ abstraction:
a pointer is an address, and an address is an integer..
布丁
\Device\NUL
布丁
A pointer carries more than merely an address
Egro
Egro
Egro
im just at the start of my "pointer" journey
布丁
For example, type information as you see in the pointer type
Egro
and what else ?
Egro
i see. i grasp it better with your explanation .
Egro
Thank you.
布丁
and what else ?
Pointer Provenance. It says that even the underlying addresses are the same, compilers may still treat two pointers differently.
布丁
This topic seems a bit advanced, but it emphasizes again that pointers are not equivalent to addresses.
Egro
your definition clear things up
布丁
I hope you don’t get confused 😂
Egro
a pointer is just a indirect way of accessing a variable...
this is clear and i comprehend it
布丁
Later when you learn arrays, you’ll probably revisit the address thing again
Egro
i learned of arrays
布丁
Then pointer arithmetics?
Egro
i am at the beginning of my pointer journey.
now i am on
int *p1, *p2, v1,v2;
v1 = 0;
p1 = &v1;
*p1 = 42;
p2 = p1;
p1 , p2 and v1 will be assigned 42.
布丁
Uh don’t worry
MaaKa
greetings everyone i have an incomplete code and please i need someone to help me end the IF (escape sequence ) of my code .. thank you
Chat Boss
MAKA sent a code, it has been re-uploaded as a file
Chat Boss
Ammar Faizi sent a huge message, it has been re-uploaded as a file
This doesn't look right:
if (temp == sum){
// do A
} else if (temp != sum) {
..
Ammar
Ammar
MaaKa
MaaKa
I will try it now
Anonymous
ahmet
What i whould learn after basics in c++
Arvin
solving some simple cases
klimi