Hello, How to round a number into nearest integer in C++? Is there any function to do that? THX!!! :):):)
wong1907
Posts
-
round off problem -
output formatIf I prefer use cout rather than printf how can I do??? THX!!!:-D:-D
-
output formathello if "i","j" are double i=1.2345678 j=2.345678 cout<
-
sorting problemHi, I am not good at programming. So, I hope somebody can help me to solve my problem. I already think it for a long time. My question is I have 2 set of datas. They are stored in variable no[i] and result[i]. no[0]=0.12 result[0]=medium no[1]=0.27 result[1]=medium no[2]=0.67 result[2]=short no[3]=0.43 result[3]=medium no[4]=0.98 result[4]=high no[i] and result[i] will combined together( i.e. 0.12 medium, 0.27 medium....) And my expected result is "0.12medium, 0.67 short and 0.98 high." How can I program it such that the computer know there have a three type of data, medium, short and high respectively. The question is so long!!! Thank you very much!!! :):):)
-
stringHello, I want to ask how to store a String in 2-D array foramt? e.g. abc[0][0]="A"; abc[0][1]="AA"; abc[0][2]="AAA"; ...... .... .. abc[n][n]="AAAAAAAAAAAAAAA"; THX!!! I am not using MFC, just the console mode!!! I think it for a long time!!!
-
stringHello, I want to ask how to store a String in 2-D array foramt? e.g. abc[0][0]="A"; abc[0][1]="AA"; abc[0][2]="AAA"; ...... .... .. abc[n][n]="AAAAAAAAAAAAAAA"; THX!!! :);):-O
-
float formathello, I have the following problem, float medium(float queueinput) { float queueout; if ((queueinput>60)&&(queueinput<65)) queueout=(0.5/5)*(queueinput-60); return (queueout); } When I execute it, it give me the warning: "=": conversion from 'double' to 'float', possible loss of data Does anyone know what's wrong inside it? THX!!! :):):)
-
random numberHello, I want to ask how to generate a random number which is lie between 0 and n, and they are evenly distributed (i.e. all number have the same probability). Calvin thx!!! :-D:omg::rolleyes:
-
transparent!!!Hi, I have a View which background colour is black, but when I use TextOut to display some texts on that view. There have a white box wrapped the text, So, I want to ask how to make the white box transparent/disappear. (i.e.It just display the text only.) Thx!!! :-D:)
-
Colour fontsOIC!!! THX YOU VERY MUCH!!!
-
Colour fontshello, I want to ask how to display colour fonts on CView?:)
-
add titleSorry, I am not very understand, could you mind further explain on it? Thx:-D
-
add titleIt is CView window, THX!!!:-D
-
add titleI have try this method, but this doesn't work!!!thanks you for your help :mad::((:)
-
add titleHIHI, I want to ask how to add a title in child window. Thx!!!:-D
-
format doubleThx you very much!!!:-D
-
format doublehello, I am looking for a way to convert a double to the char representation. e.g. double x=12.3456 char y[10]; :)
-
resizingI want to ask how to make the child frame maximize and non-resizing? Thx you very much ^_^:-O
-
full screenHow to initialize a child frame window in full screen mode? :-D
-
scroll barI also use this tricky method before. But when I execute it, even there is no error and warning are detected. The program will terminated when I open a new file. I dont know why THX!!!