Teknologi 3D pada Halaman WEB
Minggu, 09 Agustus 2026
Sabtu, 01 Agustus 2026
C++ search in array
Conversation wit
#include <iostream>
#include <string>
#include <algorithm> // Required for std::for_each and std::find
#include <iterator> // Required for std::begin and std::end
int main() {
// 1. Array of 5 names
std::string names[5] = {"Alice", "Bob", "Charlie", "Diana", "Ethan"};
// 2. View all members of the array (using std::for_each from <algorithm>)
std::cout << "Names in the array:\n";
std::for_each(std::begin(names), std::end(names), [](const std::string& name) {
std::cout << "- " << name << "\n";
});
std::cout << "\n";
// 3. Get input from user using std::cin
std::string targetName;
std::cout << "Enter a name to search for: ";
std::cin >> targetName;
// 4. Search using std::find from <algorithm>
auto result = std::find(std::begin(names), std::end(names), targetName);
// 5. Output the result
if (result != std::end(names)) {
int index = std::distance(std::begin(names), result);
std::cout << "Success! '" << targetName << "' was found at index " << index << ".\n";
} else {
std::cout << "Sorry, '" << targetName << "' was not found in the array.\n";
}
return 0;
}C++ search with cin
Conversation wit
Here is a complete C++ code sample that initializes an array of 5 names, takes input using std::cin >>, and searches for the name using std::find from the <algorithm> header:
#include <iostream>
#include <string>
#include <algorithm> // Required for std::find
#include <iterator> // Required for std::begin and std::end
int main() {
// 1. Array of 5 names
std::string names[5] = {"Alice", "Bob", "Charlie", "Diana", "Ethan"};
// 2. Get input from user using std::cin
std::string targetName;
std::cout << "Enter a name to search for: ";
std::cin >> targetName;
// 3. Search using std::find from <algorithm>
// std::find returns an iterator pointing to the found element, or std::end if not found.
auto result = std::find(std::begin(names), std::end(names), targetName);
// 4. Output the result
if (result != std::end(names)) {
// Find the index by calculating distance from the beginning
int index = std::distance(std::begin(names), result);
std::cout << "Success! '" << targetName << "' was found at index " << index << ".\n";
} else {
std::cout << "Sorry, '" << targetName << "' was not found in the array.\n";
}
return 0;
}
C++ search
#include <iostream>
#include <string>
#include <array>
#include <algorithm>
int main() {
// 1. Declare and initialize an array of 5 names
std::array<std::string, 5> names = {"Alice", "Bob", "Charlie", "Diana", "Ethan"};
// 2. Specify the name to search for
std::string target = "Charlie";
// 3. Search using std::find from <algorithm>
auto it = std::find(names.begin(), names.end(), target);
// 4. Check if the name was found
if (it != names.end()) {
// std::distance calculates the index from the iterator
int index = std::distance(names.begin(), it);
std::cout << "Found '" << target << "' at index " << index << "!\n";
} else {
std::cout << "'" << target << "' was not found in the array.\n";
}
return 0;
}
Key Takeaways
std::find(begin, end, value): Iterates through the collection and returns an iterator pointing to the first matching element. If no match is found, it returnsnames.end().std::array: Preferred over raw C-style arrays (std::string names[5]) because it works seamlessly with C++ standard algorithms likestd::find.std::distance: Converts the resulting iterator into a standard0-based array index.
C++ algorithm
#include <iostream>
#include <vector>
#include <algorithm> // For std::sort
int main() {
// 1. Creation and Initialization
std::vector<int> numbers = {5, 2, 8, 1, 9};
// 2. Adding elements
numbers.push_back(4); // Adds 4 to the end
numbers.emplace_back(3); // Constructs 3 at the end (often more efficient)
// 3. Accessing elements
std::cout << "First element: " << numbers.front() << "\n";
std::cout << "Element at index 2: " << numbers[2] << "\n";
std::cout << "Element at index 3 (bound-checked): " << numbers.at(3) << "\n";
std::cout << "Last element: " << numbers.back() << "\n";
// 4. Modifying and Sorting
std::sort(numbers.begin(), numbers.end()); // Sorts the vector
// 5. Removing elements
numbers.pop_back(); // Removes the last element (3)
// 6. Iterating through the vector
std::cout << "\nSorted vector elements: ";
for (int num : numbers) {
std::cout << num << " ";
}
std::cout << "\n";
// 7. Size and Capacity
std::cout << "Current size: " << numbers.size() << "\n";
std::cout << "Is vector empty? " << (numbers.empty() ? "Yes" : "No") << "\n";
// 8. Clearing the vector
numbers.clear();
std::cout << "Size after clear: " << numbers.size() << "\n";
std::cout<<"======================"<<std::endl;
// 1. Initialize a vector with 5 names
std::vector<std::string> names = {"Charlie", "Alice", "Eve", "Bob", "Diana"};
// 2. Sort the names in ascending (alphabetical) order
std::sort(names.begin(), names.end());
// 3. Output the sorted names
std::cout << "Sorted names:\n";
for (const auto& name : names) {
std::cout << name << "\n";
}
return 0;
}
Kamis, 23 Juli 2026
History c++
https://www.youtube.com/watch?v=lI7tMxzSJ7w&trk=feed_main-feed-card_ingested-content-summary-external-video-content
Sabtu, 18 Juli 2026
Virus Ground.exe
Ground.exe is a notoriously frustrating piece of malware. It behaves like a file-infecting companion virus. Once it gets into a computer, it copies itself into the background (usually in the AppData\Roaming folder), modifies startup registries, and actively renames standard executable files by prepending a "g" to their name (e.g., hiding the real chrome.exe and creating a malicious gchrome.exe or Ground.exe).
YouTube
+ 1
Because it continually reinfects active processes, simply right-clicking "Delete" or ending the task normally will not work—it will just regenerate on the next boot.
To vanish Ground.exe permanently from Windows 7, a systematic, isolated approach must be taken.
Step 1: Isolate the Machine & Boot into Safe Mode
Because the virus actively spreads and regenerates via running Windows processes, its main execution path must be cut off.
Disconnect from the Internet: Unplug the Ethernet cable or disconnect from Wi-Fi immediately to prevent the virus from communicating with a command server.
Restart into Safe Mode:
Shut down your computer completely.
Turn it back on and immediately start tapping the F8 key repeatedly before the Windows 7 logo appears.
2-Spyware.com
In the Advanced Boot Options menu that pops up, use the arrow keys to select Safe Mode with Networking and press Enter.
2-Spyware.com
Step 2: Terminate and Unhide the Core Virus Files
Once inside Safe Mode, standard background tasks are suppressed, allowing you to intercept the virus source.
Expose Hidden Files:
Open any folder, click on Organize (top left), and select Folder and search options.
Go to the View tab.
Select "Show hidden files, folders, and drives".
Uncheck "Hide protected operating system files (Recommended)". Click Apply and OK.
Clean Registry Startup Keys:
Press Windows Key + R, type regedit, and hit Enter.
Navigate to: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
Look at the data fields on the right. If you see any entries linking to Ground.exe or random strings executing out of AppData, right-click and Delete them.
Repeat this check in: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Wipe Temporary Directories:
Press Windows Key + R, type %appdata%, and press Enter. Look for Ground.exe or any strange folders created around the time of infection and shift-delete them.
2-Spyware.com
Do the same by opening Windows Key + R and clearing out %temp% and %localappdata%.
Step 3: Run Targeted Remediation Scanners
A normal system file check cannot fix companion viruses because they physically replicate across your software ecosystem. You need aggressive signature scanners to clean the remaining instances.
Since you are in Safe Mode with Networking, you can download these clean diagnostic tools:
Run Malwarebytes AdwCleaner: Download and run a scan via AdwCleaner. It specializes in knocking out persistent baseline adware and background browser hijackers that drop files like Ground.exe.
Run Malwarebytes Anti-Malware (Full Scan): Open Malwarebytes, navigate to Settings > Security, and ensure "Scan for rootkits" is turned on. Run a comprehensive scan. Delete everything it quarantines.
YouTube
Kaspersky Virus Removal Tool (KVRT): If the file reinfection loop persists, download the free Kaspersky Virus Removal Tool. It runs completely without installation and is highly effective at catching companion/file-infecting payloads that alter standard .exe files.
Step 4: Fix Your Altered Executables (The "g" Files)
Once the main Ground.exe engine is deleted, you may notice that some applications fail to launch or their icons appear transparent. This happens because the virus renamed your actual apps to hidden names starting with a g (e.g., gchrome.exe or gspotify.exe).
GitHub
Go to the installation directory of any broken application (e.g., C:\Program Files\).
Look for the hidden executable files starting with g.
If the scanner did not delete the decoy file, delete the fake, infected file (usually labeled the original application name).
Rename the healthy g file back to its normal name (e.g., change gchrome.exe back to chrome.exe).
(Alternatively, simply uninstalling the broken apps and doing a fresh download/reinstall will completely clear out the corrupted remnants).
GitHub
Important Security Note for Windows 7
Windows 7 officially reached its End of Life (EOL) years ago, meaning it no longer receives security updates or patches from Microsoft. This makes the operating system highly vulnerable to modern file-injectors, rootkits, and execution exploits like Ground.exe. If your hardware supports it, it is strongly recommended to back up your critical data onto an external drive and upgrade the machine to a newer, securely supported operating system.





