[Solved] How to make a Worst case in mergesort in c? [closed]

[ad_1] The way mergesort works is dividing the array in two arrays, recursively (logn times), untill being able to compare pairs of elements. Then it merges the recursively created arrays also sorting them at the same time. For some sorting algorithms (e.g. quicksort), the initial order of the elements can affect the number of operations … Read more

[Solved] How to call a form when there are 3 forms in a project and data Transfer between the forms in C#?

[ad_1] Can you explain why you don’t want to touch your Program.cs file? This is exactly where you change the start-up form. Change the: Application.Run(new Form1()); to: Application.Run(new Form4()); Secondly, you can set the filters on Open- and SaveFileDialog using the Filter property. Set it to a value like this: XML Files|*.xml Or for text: … Read more

[Solved] Looping – amount of years from months

[ad_1] thanks to everyone who gave a answer 😀 much appreciated i got it working like this in the end int employmentInMonthsAmount = this.MaxEmploymentHistoryInMonths; var intcounter = 0; int years = 0; for (var i = 0; i < employmentInMonthsAmount; i++) { if (intcounter >= 12) { years++; intcounter = 0; } intcounter++; } var … Read more

[Solved] C++ error at the last line of code

[ad_1] The code that works is here #include <iostream> #include <cstdlib> #include <time.h> using namespace std; int number_normal; int number_hard; int guess_normal; int guess_hard; int tries_normal=0; int tries_hard=0; int mode; int main() { { cout<<“Choose your mode…”<<endl; cout<<“Normal (Press 1) or Hard (Press 2)”<<endl; cin>>mode; if(mode=1) cout<<“Normal mode chosen.”<<endl; goto normal; if(mode=2) cout<<“Hard mode chosen!”<<endl; … Read more

[Solved] Streamreader locks file

[ad_1] StreamReader smsmessage = new StreamReader(filePath); try { FileInfo filenameinfo = new FileInfo(filePath); …. smsmessage = filenameinfo.OpenText(); … You are initializing smsmessage twice, but only disposing one of those instances. The first line constructs a StreamReader, and then you overwrite your reference to that instance with the instance created by filenameinfo.OpenText(). That leaves you with … Read more

[Solved] Inserting ISO date in sql server

[ad_1] @dlatikay! based on your first comment i changed the datatype from DateTime to string and it worked. dTable.Columns.Add(“created_on”, typeof(string)); When the datatype is DateTime,the result is coming as expected,but on insertion to sql the value is changing.Now, while iam sending the value as string to sql,it is converting that string to DateTime and it … Read more

[Solved] If two Table’s data are independant, but they have relationship (one Main, another Sub). What is the best way to link them?

[ad_1] Well you are on your with the last comment creating a Foreign Key. So we have a relationship between Customers and Contacts. However the outstanding question becomes what type is Customer:Contact relationship? One-to-One (1:1) -> Each Customer has one contact and a Contact is for one customer. One-to-Many (1:M) -> Each Customer has many … Read more

[Solved] How split space to fill dataGridView from file .txt in C#

[ad_1] Take look on line string[] Columns = line.Split(‘,’); You try to split line by comma, but no commas in the file. Try split by space. Like string[] Columns = line.Split(‘ ‘); Or string[] Columns = line.Split(new []{‘ ‘}, StringSplitOptions.RemoveEmptyEntries) 1 [ad_2] solved How split space to fill dataGridView from file .txt in C#

[Solved] elusive c function declared in header [closed]

[ad_1] double (*WELLRNG19937a) (void) is a pointer to a double funcname (void) function. In the first function void InitWELLRNG19937a (unsigned int *init) you can see WELLRNG19937a = case_1; where case_1 is double case_1 (void) Then in main you are calling a function poited by WELLRNG19937a pointer. The real called function will be case_1. Deleting InitWELLRNG44497a(&u) … Read more