[Solved] I am making a visual C# winform application. I want to store data in it [closed]

[ad_1] To create files, you will be using the System.IO.File namespace. This gives you access to methods such as Create(), CreateText(), WriteAllBytes(). Which method you use will depend on what type of data you are using. To save the file in your application directory, you can get the path using AppDomain.BaseDirectory So for example if … Read more

[Solved] Still Learning ‘System.StackOverflowException’ was thrown.’

[ad_1] The problem is in TeamLeader::getData() getTBonus() is calling getTPay() which is calling getTBonus() again causing an infinite loop, which will throw the StackOverflowException. You might try using if…else if in those methods instead of just if. public decimal getTBonus() { decimal tBonus = 0; if (TrainHours <= 0 && Hours <= 0) { tBonus … Read more

[Solved] Check whether a string is in a list at any order in C#

[ad_1] This works for me: Func<string, string[]> split = x => x.Split(new [] { ‘#’ }, StringSplitOptions.RemoveEmptyEntries); if (XAll.Any(x => split(x).Intersect(split(S)).Count() == split(S).Count())) { Console.WriteLine(“Your String is exist”); } Now, depending on you you want to handle duplicates, this might even be a better solution: Func<string, HashSet<string>> split = x => new HashSet<string>(x.Split( new [] … Read more

[Solved] Why doesn’t this code for Sutherland-Hodgeman Line Clipping algorithm giving incorrect output?

[ad_1] You can use a std::vector without initializing its size and it supports random access. To add to an empty std::vector use push_back std::vector<MyType> vec; vec.push_back(MyType(10, ‘a’, “Hi”)); vec.push_back(MyType(20, ‘b’, “Hello”)); vec.push_back(MyType(30, ‘c’, “Bye”)); MyType t = vec[1];//20,’b’, “Hello”… Edit: This answer is for the question that was originally asked. 3 [ad_2] solved Why doesn’t … Read more

[Solved] How can i define a bool array in VC++ with more than MAXINT Elements

[ad_1] class largeBoolArray { private: bool **myMintherms; unsigned long long dim; unsigned int dimPointers; public: largeBoolArray() { myMintherms = NULL; dim = 0; dimPointers = 0; }; largeBoolArray(unsigned long long Dim) { assert(Dim > 0); dim = Dim; dimPointers = ((unsigned int) (Dim & 0xFFFFFFFF80000000) >> 31) + 1; myMintherms = new bool*[dimPointers]; for (unsigned … Read more

[Solved] C++ – DFS code error

[ad_1] The problem is that you haven’t coded DFS-VISIT step 4 correctly Step 4 says for each v ∈ G.Adj[u] but your code says for(int i=0; i<G; i++). Those aren’t the same thing at all. You should only visit the adjacent vertexes. In fact if you look at your code you never use adj at … Read more

[Solved] C# Array Different indexes

[ad_1] Thanks everey one finaly i fixed it by your guid thanks all myarr = new mytable[50]; number_of_records = 0; number_of_records = fulllines.Length; for (int line = 1; line < fulllines.Length; line++) { int c = 0; for (int i = 0; i < record_lenth; i++) { string data = “”; string currentline = fulllines[line]; … Read more

[Solved] error: expected ‘)’ before ‘*’ token

[ad_1] You omitted the typedef that you need to declare your struct alias s. The struct’s member is b rather than a. You failed to return anything from your functions. These should be void functions. You need parens around ss in func1. The parameterless main in C is int main(void).   #include <stdio.h> typedef struct … Read more