[Solved] What’s done in this line of code? [closed]

[ad_1] It creates a constant value named RADIX, which is the radix value for the non-standard type Doub. A radix for a floating-point type is the base of the exponent of its representation (usually 2, but since we don’t know what Doub is, it could also be a custom numeric class which uses a different … Read more

[Solved] C# Regular expression: how to get one of two texts with condition?

[ad_1] You can capture each value and use the MatchEvaluator to process the groups. string inputString = “[sex:he|she] took the dog with [sex:him|her]”; string result = Regex.Replace(inputString, @”\[(?<name>[^:]+):(?<value1>[^\|]+)\|(?<value2>[^\]]+)\]”, Evaluator); And the evaluator could replace any group with the appropriate response: private string Evaluator(Match match) { if (match.Groups[“name”].Value == “sex”) { if (m_IsMale) { return match.Groups[“value1”].Value; … Read more

[Solved] Program gives unstable output? [closed]

[ad_1] New code that works: #include <stdio.h> #include <conio.h> #include <string.h> #include <stdlib.h> #include <time.h> int main() { int i,j=0,code,amt, key,lines=0; int id[100],stock[100],k=0; char name[100][20],product[100]; float price[100],sum; float total=0; char ipname[100][20]; int quantity[100], ch; float ipprice[100]; float ipsub[100]; FILE*fp1; fp1=fopen(“Fruit.txt”,”r”); if(fp1==NULL) { printf(“ERROR in opening file\n”); return 1; } else { while((ch=getc(fp1))!=EOF) { if(ch==’\n’) lines++; … Read more

[Solved] bank, 4 atm machine input txt files, syncing information between them with semaphores

[ad_1] I know it’s tagged c, but since you spammed it in Lounge<C++>, let me humor you with C++: Live On Coliru #include <algorithm> #include <functional> #include <atomic> #include <fstream> #include <iostream> #include <list> #include <mutex> #include <sstream> #include <string> #include <thread> #include <vector> // not thread-aware: struct Bank { struct Account { int id; … Read more

[Solved] expected ‘)’ error in a c++ code [closed]

[ad_1] void Bresenham(int x1,int y1, int x2, int y2, colour) ^ you forgot the type here It should be void Bresenham(int x1,int y1, int x2, int y2, int colour) ( But you are not even using this function in your code ) You should also use int main() over void main() int main() { // … Read more

[Solved] having trouble with global variable

[ad_1] There is no such thing as global variables in C#. This will do the trick for you. You could also try the static class with static members solution to simulate something like global variables, but that still won’t be a global variable. Try this (you’re using an attribute in the class in this solution, … Read more

[Solved] Labelcontrol In Devexpress [closed]

[ad_1] According to this topic in DevExpress Support Center: It is not possible to render HTML content in the XRLabel control. To accomplish this task, you can use the XRRichText control and bind the HTML property of this control to the corresponding property in your DataSource. 4 [ad_2] solved Labelcontrol In Devexpress [closed]

[Solved] What code is more CPU expensive: while(*p) or while(i–)? [closed]

[ad_1] *pointer nominally requires a fetch from memory, and that is generally the most expensive of the operations shown in your code. If we assume your code is compiled directly to the obvious assembly corresponding to the operations as they are described in C’s abstract machine, with no optimization, modern CPUs for desktop computers are … Read more

[Solved] .NET bug. How to fix?

[ad_1] I solved this problem by using the Dispatcher: private void grid_SizeChanged(object sender, SizeChangedEventArgs e) { //text.Text = grid.Width.ToString(); Dispatcher.BeginInvoke(new Action(() => text.Text = grid.Width.ToString())); } Thank you all for “help” and negative rating. [ad_2] solved .NET bug. How to fix?