Anonymous
Do anybody have c notes I require
Kaashᅠ
Decimal
thanks😅😅.. I was just trying to understand this.. I'm somewhat new to it
Anonymous
thanks😅😅.. I was just trying to understand this.. I'm somewhat new to it
This is used to prevent format string vulnerability. Instead of writing printf(i) you need to write the code above because the attacker can insert malicious input to an "i" theoretically
Anonymous
If you will write printf("%x \n", i), you will get a hexadecimal form of number in i
Kaashᅠ
i got it😃
Kaashᅠ
It's C language?
Anonymous
Yes
Kaashᅠ
ohh i see, printf is written there
Anonymous
hello guys i build program to create files and print content files on linux
Anonymous
i cant send images.or any media if u want more info index me . i build it with C++
Nessie
Hi all, i'm newmember. Nice to meet !
Nessie
i have tried porting this code from c# to c++ , but failed many times , can someone help me learn ? ———————————— public float ReadFloat(int MemoryAddress) { byte[] buffer; return this.ReadMem(MemoryAddress, 4U, out buffer) == 0 ? 0.0f : BitConverter.ToSingle(buffer, 0); } ————————————
Nessie
What have you tried so far?
float GetFloatTest(DWORD offset) // OK { DWORD OldProtect; float Value; VirtualProtect((void*)offset, 4, PAGE_EXECUTE_READWRITE, &OldProtect); if ((*(float*)(offset)) > 0.0f) { Value = *(float*)(offset); } else { Value = 0.0f; } VirtualProtect((void*)offset, 4, OldProtect, &OldProtect); return Value; }
Nessie
What have you tried so far?
float ReadFloat(int MemoryAddress) { float Value; if ((*(float*)MemoryAddress) == 0) { Value = 0.0f; } else { Value = *(float*)MemoryAddress; } return Value; }
Nessie
Assuming this.ReadMem just reads n bytes from the address, this looks correct.
this is Readmem public int ReadMem(int MemoryAddress, uint bytesToRead, out byte[] buffer) { IntPtr num = ProcessMemoryReaderApi.OpenProcess(56U, 1, (uint) this.m_ReadProcess.Id); if (num == IntPtr.Zero) { buffer = new byte[0]; return 0; } buffer = new byte[(IntPtr) bytesToRead]; IntPtr lpNumberOfBytesRead; ProcessMemoryReaderApi.ReadProcessMemory(num, (IntPtr) MemoryAddress, buffer, bytesToRead, out lpNumberOfBytesRead); ProcessMemoryReaderApi.CloseHandle(num); return lpNumberOfBytesRead.ToInt32(); }
Nessie
will this cause me to convert it ?
Prince Fine
Can someone tell me what's the use of setConsoleColor ( )
\Device\NUL
It worked with single & too...
It's bitwise operator
Anonymous
It's bitwise operator
Yes but booleans implicitly get converted to 1 or 0. So bitwise & has the same behavior as logical &&.
Talula
It's bitwise operator
I know but the program works.
Talula
Because I think it doesn't make any difference, because you're checking for 0 or not 0...
Anonymous
Because I think it doesn't make any difference, because you're checking for 0 or not 0...
In that case, both are AND (one logical and one conditional) But they have different meaning and might result in different code (hopefully it's optimized and then it's the same code)
Anonymous
But for conditional shit u should use the conditional one (&&).
Tran
Anyone know about competitive programming with c++ ?
coal
Anyone know about competitive programming with c++ ?
i know about competitive programming but not exclusively about C++
Tran
it's about graph, dynamic programming, arithmetic...
klimi
Anyone know about competitive programming with c++ ?
This is quite a meta questions, do you really just want to know if there are competitive programmers who code in c++ or something else?
Mr. One
Join free today
danya
Hello everyone,i have one question,How to take a word from an array one by one? C Like this: Hello Kitty, say, how are you doing today? Kitty, how you today?
Prince Fine
?
I can't send a screenshot of my code 🥲
Mustapha
My first programming
Mustapha
#include <iostream> using namespace std; int main () { int M1, M2, M3, M4, grade; cout<< "Enter the four Marks: "; cin>>M1>>M2>>M3>>M4; grade = (M1+M2+M3+M4) / 4; if ( grade > 50) cout<<"A"; else cout<<"C"; return 0; }
A
👍
Prince Fine
hey guy's what will this code do if ( gender ! = ' m ' && gender ! = ' M ' && gender ! = ' f ' && gender ! = ' F ' ) { return false; }
Prince Fine
Should it be && or ||
Golden Age Of
Should it be && or ||
Depends on what you want to say
Prince Fine
Depends on what you want to say
what i want to do was if the user enters ' m ' or ' f ' or ' M ' or ' F ' it will return true
Prince Fine
if not false
Prince Fine
Golden Age Of
Ye
Prince Fine
void getArtistGender(char& genders) { bool isvalid; do { cout << " Enter the gender of the artist(Male = M / Female = F ): "; cin >> genders; isvalid = validateGender(genders); if (!isvalid) { cout << " ERROR! Incorrect Gender . Please enter again . " << endl; } } while (!isvalid); } bool validateGender(char gender) { if (gender != 'm' && gender != 'M' && gender != 'f' && gender != 'F') { return false; } return true; }
EZ
Write a recursive function that find the numbers of letters in a given word.
arfa
hi. how can i set background color tu shape, and when we click it it will change color
Mustapha
Talula
After ""if (grade>50) """ Need to use braces {} ??
Not required if you have a single function to execute.
Kaashᅠ
Not required if you have a single function to execute.
Like, we have to use two Couts in if statement.. Will have to use braces or not?
Prince Fine
Kaashᅠ
why
disabled
Prince Fine
disabled
don't u think it's easier if we send screenshots than writing
Ludovic 'Archivist'
Anyone know about competitive programming with c++ ?
The only form of competitive programming I partake in is the IOCCC and my code read like an OCR of Mesopotamian clay tablets done with a software that only supports NASDAQ company codes
klimi
why
because we disabled it in the group settings
Kaashᅠ
don't u think it's easier if we send screenshots than writing
yeah it's easier but, Just to prevent spam or filling up storage is the reason behind, i think
Prince Fine
klimi
don't u think it's easier if we send screenshots than writing
don't you think it's easier to run the code than run the image?
klimi
and when pictures were enabled, we would get students taking pictures of school computers with their exams begging for answers... which is not what this group is about
Anonymous
Hey what are constant, volatile and constant volatile variables
klimi
Hey what are constant, volatile and constant volatile variables
const = cannot by changed volatile = can be changed outside of the thread
klimi
ask your question straight or don't spam