Anonymous
Hi
void
and this approach is taken almost in all operating systems
Windows docs dont talk about this issue
Anonymous
Am new here
void
I can't find a reference to this bug there
Hussein
Windows docs dont talk about this issue
yeah because it isn’t really an issue since it cannot cause any binary exploits because obviously you don’t expect the kernel to give you malicious addresses and your program will crash anyway
void
windows don't guarantee the returned address on this scenario?
void
is there any note about this?
Hussein
then the behaviour is the same on windows?
well this mentioned almost in any book and paper discussing this scenario basically it would be an stupid approach to bother returning -1 for a program that is going to be killed anyway
Hussein
then the behaviour is the same on windows?
this is expected to happen if you run your program on the WindowsNT kernel
void
pavel
Ok, but is a common recomendation to check malloc's return. I don't undenstand why this check is still recommended.
Really nobody do that. Only in debug build in stl functions of when you try to allocate big chunk of memory
pavel
Generally if malloc can't allocate memory - something wrong in your system, and process will crush anyway
void
Really nobody do that. Only in debug build in stl functions of when you try to allocate big chunk of memory
Agree, I try to find documentation to discuss this point in my university. Thanks for the information
pavel
Almost all big projects have own memory manager
void
yep
pavel
Depends on your project you can implement object pools
Hussein
Ok, but is a common recomendation to check malloc's return. I don't undenstand why this check is still recommended.
your process will be killed only if it consumed more than any other process but sometimes your process isn’t the one that should be killed (probably chrome processes should be killed😂) then they may get killed and in your program mmap() will return -1 and malloc() will return 0 because the operating system had some trouble allocating memory for you at the time also the kernel tries to resolve fragmentation in memory so if you ask for large page than the available clean pages mmap will fail and malloc will return 0 because the empty gaps in your memory is not large enough for the size of the memory page you requested
pavel
Or even batched memory allocator
pavel
Usually it happen when you try to allocate big memory chunk, larger than fragmentation gaps
pavel
Or if you try to allocate memory from some device like GPU
void
then even if I have an address I will not be able to be sure that it is available
pavel
Of you're deal with large memory allocation in runtime you can check how much free ram available before allocation
void
thanks for the time, really
Sarmat
hello guys, how can i connect my c++ app to firebase? (google database), i found one guide in youtube, but it not worked for me. does anyone in this chat connect to firebase by c++? do you have code example?
Hussein
then even if I have an address I will not be able to be sure that it is available
just keep your memory consumption as low as possible and write how much memory your program needs in the system requirements so the user can estimate how much memory he/she may needs
pavel
Or can follow this way) https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98125
Hussein
wait how can you post links here? last time I did it I got a warning
pavel
Idk, just post. Maybe some domain in white list
pavel
Or i will be reported later
Hussein
ok thanks
İbn
Write a program in C++ that defines a single array of 50 int positions, generates random numbers in this array, rotates the array elements left by 5, and prints every 5 elements in a row ??
pavel
Students..
İbn
Write the code for multiplying two 3*3 binary matrices. _Where the condition for multiplying the two matrices is that the first has a size of (n*m), and the size of the second is (m*h),, and the result is (n*h) ?
Justin Amos Akplehe
Is it necessary to study core programming to become an ethical hacker?
pavel
Sure
Hussein
yes
İbn
Yes
Can you help ?
pavel
Can you help ?
No, just not interesting. Usual homework for beginners
Anonymous
If you wanna someone else does your homework, why do you just study software-engineering? The key is doing homework, so you’ll learn the subject. Else… You’ll become a copycat.
pavel
Copycat at least must know how to compile something
Justin Amos Akplehe
What does it take to call one a c++ programmer?
Anonymous
C++
Oooh thought its C, i find it easier
Anonymous
İbn
No problem
Anonymous
Cool
줄리아 우지야노바
#markdown
\Device\NUL
but GNU libc dont guarrantee the address returned by malloc
That doesn't depend on libc. the man pages has no relation with it. (There are some libc function that following standard and some that don't, malloc and calloc are on ISO C) malloc and calloc can fail and will return NULL, otherwise it's not following ISO C. they don't have any relation with specific OS or toolchain
Phlexy
Good evening I'm Prince Samuel A student
Phlexy
I'm looking forward to learn from hournable people like u all in this group
Phlexy
Please I have some questions which I will be glad if I can get the source codes 🙏
Prometheus
Phlexy
Not necessarily that But I want someone to actually help me with my assignment 🙏🙏
Phlexy
*Task For Individual Presentation on 28th June, 2022* *In each of the task make sure the user makes an input at runtime.* *Again, make sure that, the user is able to repeat input data for not less than 10 entries before the program terminates...* *The task will be inspected on Tuesday 28th June, 2022 Godwilling. Each student will project and do a presentation for the award of marks.* *Anybody who may come with any form of excuses hoping to escape the presentation shall straight away get a mark of ZERO without delay.* *1. Write a c program to print fibonacci series. Research to understand what fibonacci series means in mathematics to gain a better understanding.* *2. Write a c program to check prime number. User should make an input and the program should tell whether the inputted number is prime number or not.* *3. Write a c program to print factorial of a number.* *4. Write a c program to print sum of digits. Example if i type 234 it should print out 9.* *5. Write a c program to reverse given number. Example if i type 1234, it should print out 4321.* *6. Write a c program to print multiplication of a given number.* *7. Write a c program to convert decimal number to binary.* *8. Write a c program to calculate the grade of PU students. The output should be arranged in a tabular form for easy reading. Use the data below:* *Score* *Grade* *Description* 80-100 A Distinction 75-79 B+ Very Good 70-74 B Good 65-69 C+ Above Average 60-64 C Satisfactory 55-59 D+ Below Average 50-54 D Poor 45-49 F Fail <44 I Resit *9. Write c program that can print numbers from 1 to any number. E.g. 1 to 100, 1 to 2000, etc.* *10. Write c program that can change color around texts by blinking.* *Thank you.*
Prometheus
*Task For Individual Presentation on 28th June, 2022* *In each of the task make sure the user makes an input at runtime.* *Again, make sure that, the user is able to repeat input data for not less than 10 entries before the program terminates...* *The task will be inspected on Tuesday 28th June, 2022 Godwilling. Each student will project and do a presentation for the award of marks.* *Anybody who may come with any form of excuses hoping to escape the presentation shall straight away get a mark of ZERO without delay.* *1. Write a c program to print fibonacci series. Research to understand what fibonacci series means in mathematics to gain a better understanding.* *2. Write a c program to check prime number. User should make an input and the program should tell whether the inputted number is prime number or not.* *3. Write a c program to print factorial of a number.* *4. Write a c program to print sum of digits. Example if i type 234 it should print out 9.* *5. Write a c program to reverse given number. Example if i type 1234, it should print out 4321.* *6. Write a c program to print multiplication of a given number.* *7. Write a c program to convert decimal number to binary.* *8. Write a c program to calculate the grade of PU students. The output should be arranged in a tabular form for easy reading. Use the data below:* *Score* *Grade* *Description* 80-100 A Distinction 75-79 B+ Very Good 70-74 B Good 65-69 C+ Above Average 60-64 C Satisfactory 55-59 D+ Below Average 50-54 D Poor 45-49 F Fail <44 I Resit *9. Write c program that can print numbers from 1 to any number. E.g. 1 to 100, 1 to 2000, etc.* *10. Write c program that can change color around texts by blinking.* *Thank you.*
Have you learned what the fibonacci series is?
Prometheus
Not yet please
So do some work on it and come back when you have some stuff done. We'll be happy to help with questions then.
Phlexy
I will do some digging into that and get back to u
Phlexy
Thank you
Prometheus
Justin Amos Akplehe
*Task For Individual Presentation on 28th June, 2022* *In each of the task make sure the user makes an input at runtime.* *Again, make sure that, the user is able to repeat input data for not less than 10 entries before the program terminates...* *The task will be inspected on Tuesday 28th June, 2022 Godwilling. Each student will project and do a presentation for the award of marks.* *Anybody who may come with any form of excuses hoping to escape the presentation shall straight away get a mark of ZERO without delay.* *1. Write a c program to print fibonacci series. Research to understand what fibonacci series means in mathematics to gain a better understanding.* *2. Write a c program to check prime number. User should make an input and the program should tell whether the inputted number is prime number or not.* *3. Write a c program to print factorial of a number.* *4. Write a c program to print sum of digits. Example if i type 234 it should print out 9.* *5. Write a c program to reverse given number. Example if i type 1234, it should print out 4321.* *6. Write a c program to print multiplication of a given number.* *7. Write a c program to convert decimal number to binary.* *8. Write a c program to calculate the grade of PU students. The output should be arranged in a tabular form for easy reading. Use the data below:* *Score* *Grade* *Description* 80-100 A Distinction 75-79 B+ Very Good 70-74 B Good 65-69 C+ Above Average 60-64 C Satisfactory 55-59 D+ Below Average 50-54 D Poor 45-49 F Fail <44 I Resit *9. Write c program that can print numbers from 1 to any number. E.g. 1 to 100, 1 to 2000, etc.* *10. Write c program that can change color around texts by blinking.* *Thank you.*
Which school?
Prometheus
Which school?
The one where other people do your work for you lol
MRT
How can I rewrite the second 128 bits of a 256-bit data? for first 128 bit slot i use or(and(w,not(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)), and(0x0,0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
\Device\NUL
You can't actually delete / create data in computer terms, there are only 1 and 0.