[Solved] C – Read and write bytes from memory

This is not “pure C” question, because C language standard doesn’t define how to access physical, linear or virtual memory at given address. In many or most environments, operating system won’t never let you directly access physical memory, or will only let you access physical memory if you ask it. For example on Linux with … Read more

[Solved] How to get all characters betwent “[\”” and “\”,”? [duplicate]

Your task can be effectivelly accomplished using regular expressions. Your regex could look like: (?<=\[“)[^”]+ See it live here. The (?<=\[“) part is so called lookbehind, you say you are looking for anything that follows [“. Then you simply take any characters except ” Extract from .NET Regex Reference: (?<= subexpression) Zero-width positive lookbehind assertion. … Read more

[Solved] My loop condition isn’t being met

Have you tried: std::string one = “stringa”; std::string two = “stringb”; std::string three = “stringa”; std::string four = “stringb”; if( one == three && two == four ) { return true; } else { return false; } 1 solved My loop condition isn’t being met

[Solved] Communicate With Online Message Board [closed]

This is actually more complicated than it sounds. Most message boards don’t open up their API (usually to prevent spam), and if they do, you’ll probably have to work with them to get the details. The general idea is: Open socket to their server Send the appropriate data according to their API Profit If you … Read more

[Solved] Error in accepting the value from console in c? [closed]

I think this may help you a little. the function scanf will read and ignore any whitespace characters encountered before the next non-whitespace character (whitespace characters include spaces, newline and tab characters — see isspace). A single whitespace in the format string validates any quantity of whitespace characters extracted from the stream (including none). Also … Read more

[Solved] I am going to create simple logger using C# so what are the design patterns I can use to create this as best practice? [closed]

Well, the obvious choces are Strategy (one logger that can be configured to use different output options) and Composite (multiplex output over several output outions). So something like this (in Java): public class Logger { public interface LogOutput { void out(final String s); } // Composite – use to send logging to several destinations public … Read more

[Solved] Console doesnt display histogram

getchar is still an int by the POSIX and C standards. Did you forget to include stdio.h or include something that redefines it? This example works for me: #include <stdio.h> int main() { int c; c = getchar(); } solved Console doesnt display histogram

[Solved] A Codility test that needs to be solved

The function can look as it is shown in the demonstrative program #include <iostream> #include <algorithm> #include <vector> long long int solution( const std::vector<int> &v ) { long long int max_sum = 0; for ( auto it = v.begin(); ( it = std::find_if( it, v.end(), []( int x ) { return !( x < 0 … Read more

[Solved] How Get relative path [closed]

Use these methods to generate urls relative to pages that you execute them within: this.Page.ResolveUrl this.Page.ResolveClientUrl this.Page.ResolveUrl(“~/Uploads/Picture/Commodities/1390/11/TumbDesert.jpg”); this.Page.ResolveClientUrl(“~/Uploads/Picture/Commodities/1390/11/TumbDesert.jpg”); solved How Get relative path [closed]