[Solved] Generate Every Possible 2 Character Combination [duplicate]

[ad_1] Create an array of all your characters and then do a nested foreach loop to generate each possible combination. static void Main() { IList<char> characters = new List<char> {‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘1’, ‘2’, ‘3’}; foreach (char c1 in characters) { foreach (char c2 in characters) { Console.WriteLine(new string(new[] {c1, c2})); … Read more

[Solved] Using variables gives error [closed]

[ad_1] Since UNICODE isn’t really your frind I’d suggest that you use the “FtpRenameFileA” function instead of the “FtpRenameFile” function. This results in: if (FtpRenameFileA(hFtp,”log.txt”,funsys)) { MessageBox(NULL, L”Renamed Successful.”, L”Title”, NULL); } else { MessageBox(NULL, L”Renamed Failed.”, L”Title”, NULL); } 3 [ad_2] solved Using variables gives error [closed]

[Solved] Seeking feedback on my design of LINQ expressions [closed]

[ad_1] You’re comparing apples and oranges. Each of the approaches you list has benefits and drawbacks, so it’s impossible to answer which is the “preferred way.” Likewise, many of these examples will return immediately because they use deferred execution, so they’ll technically run faster, but won’t actually make your program run any faster. But if … Read more

[Solved] Can’t update decimal field in mssql

[ad_1] The problem was that I called the ExecuteAsync method inside multithreading and the thread was closed before the ExecuteAsync method returned the result. I fixed it by replacing the ExecuteAsync method with the Execute method. The .Wait() didn’t help nor the getawaiter. 1 [ad_2] solved Can’t update decimal field in mssql

[Solved] Variable has two values simultaneously?

[ad_1] Changing a const-value yields undefined behaviour, and the “mysterious” output is just such undefined behaviour. It is actually needless to investigate on why a behaviour in the world of undefined behaviour is as it is then. But in your case it is probably not using a as you declare it as const, so the … Read more

[Solved] C++ mysterious code. any security issue? [closed]

[ad_1] This with g++ compiles, and I don’t think there’s any UB struct Va { Va(struct Foo&, int) {} }; int operator++(const Va&, int) { return 42; } struct Foo { Va va; Foo(Foo &afoo) : va(afoo,va++) {} }; to be specific operator++ is not doing anything with the not-yet-initialized va data member. It’s more … Read more

[Solved] WPF Shaped Button – Visaul Studio/Blend

[ad_1] You need to create a ControlTemplate for the Button. This can be done both in Blend and Visual Studio. I did it in VS2015. Here is your code: But, for the future, try to do some work yourself before posting the question. Include just enough code to allow others to reproduce the problem. For … Read more

[Solved] What is wrong with this C program [closed]

[ad_1] The first problem is that you are not allocating memory for each char*. mem is a pointer to a pointer. This means this value will need allocation (as you do): mem = (char **)malloc(sizeof(char*) * 2048); You can remove the 512 from your code because this only needs memory for the pointers themselves not … Read more

[Solved] Unexplainable bug in my code

[ad_1] There are several issues with your code (using legacy APIs, using bad parameters, missing logic, etc). Try something more like this instead: #include <iostream> #include <Windows.h> const DWORD transparenton = 0x00000001; const DWORD transparentoff = 0x00000000; using namespace std; void pause(); void act(HKEY key); bool getTransparency(HKEY key, DWORD &value); void setTransparency(HKEY key, DWORD value); … Read more

[Solved] Difference between new Class() { … } and new Class { … } [duplicate]

[ad_1] Nothing. When using the object initialiser syntax { }, the () for a parameterless constructor is optional. From the overview of C# 3.0, where this syntax was introduced: An object creation expression can omit the constructor argument list and enclosing parentheses, provided it includes an object or collection initializer. Omitting the constructor argument list … Read more