Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

winforms - Problem with return in C# -


because of asking last question, i've changed code use return. have problem return: know should use return (where comment in code below) dont know how should define work? help.

public double bigzarb(int u, int v) {     double n;     int x=0;     int y;     int w=0;     int z;     string[] = textbox7.text.split(',');     int[] nums = new int[i.length];     (int counter = 0; counter < i.length; counter++)     {         nums[counter] = convert.toint32(i[counter]);     }      u = nums[0];     double firstdigits =math.floor(math.log10(u) + 1);     v = nums[1];     double seconddigits = math.floor(math.log10(v) + 1);     if (firstdigits >= seconddigits)     {         n = firstdigits;     }     else     {         n = seconddigits;     }     if (u == 0 || v == 0)     {         messagebox.show("the multiply 0");     }     string threshold = textbox9.text;     int intthreshold = convert.toint32(threshold);     int intn = convert.toint32(n);     if (intn <= intthreshold)     {         double uv = u * v;         string struv = uv.tostring();         messagebox.show(struv);         ///i know here should return dont know how define work     }     else     {         int m = convert.toint32(math.floor(n / 2));          x = u % 10 ^ m;         y = u / 10 ^ m;         w = v % 10 ^ m;         z = v / 10 ^ m;          return  bigzarb(x, w) *math.pow(10,m) +(bigzarb(x,w)+bigzarb(w,y))*math.pow(10,m) +bigzarb(y,z);     } } 

arash, problem isn't return, problem bigzarb() declared void means has no returning value yet use in last line bigzarb(x,w) * .... give error. also, since declared bigzarb() void, cant return value in it. ^ doesn't mean power of in .net, should use math.power instead.

edit: should change method void bigzarb() double bigzarb() , replace ^ math.power , retry see if yit works.

last edit: change method return type double int , change last line to:

return bigzarb(x, w) * math.pow(convert.todouble(10), convert.todouble(m)) + (bigzarb(x, w) + bigzarb(w, y)) * math.pow(convert.todouble(10), convert.todouble(m)) + bigzarb(y, z); 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -