Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,078 members, 7,957,019 topics. Date: Tuesday, 24 September 2024 at 04:39 AM |
Nairaland Forum / Science/Technology / Programming / . (1829 Views)
We are all Geeks, Discuss your ideas / Jokes For Geeks / --theory: Geeks, Computer Hobbyists And Programmers Hardly Gets The Girl Quick? (2) (3) (4)
. by holyboss: 1:20pm On Nov 20, 2015 |
. |
Re: . by codemarshal08(m): 7:36pm On Nov 20, 2015 |
Hmm bro. what do you not understand in those codes ? |
Re: . by Nobody: 10:54pm On Nov 20, 2015 |
Lazy man! Make we do your home work for you? |
Re: . by Intellab(m): 11:39pm On Nov 22, 2015 |
I think in 2, result will be displayed as 30.0.
You declared num1 as integer. For num2, you should use double instead.
//I'm not a c++ pro. |
Re: . by Nobody: 2:05am On Nov 23, 2015 |
holyboss: The first one is like a flat-file database. Simply put Notepad.. It uses a notepad or text editor to store data even after the program stops running!! Enough of the explanation, the above program in number 1(one) is only trying to access a text document from the stipulated path name, the "while" statement checks if it really does exist. 2. Although I haven't debugged your codes but I think I have an idea of what that does, you see my friend when you actually want to determine the size of let's say a variable in the memory, such function could be used. In context to this program, it actually determines the memory size or actual size of each variables then proceeds by determining its arithmetic sum, of cause you know it provides the output!!!! I hope this was of help to you!!! Have a nice day!!! 3 Likes 2 Shares |
Re: . by Nobody: 8:53am On Nov 23, 2015 |
Your second code is wrong. Why use int and float at the same time? Code should have looked like this
Now the first one apparently u using ofstream(file stream) which you must include the header file #include <fstream> |
Re: . by Nobody: 8:55am On Nov 23, 2015 |
Ezechinwa: Using sizeof to add and using float? This code will produce powerful errors. |
Re: . by Diakon(m): 11:15am On Nov 23, 2015 |
holyboss: How come no one has given a sensible answer to number 2? Your code in number two adds your two variables. It promotes the int to a float (in order to enable the addition) and this results in an answer of type float. Thus, the sizeof operator gives you the size of a float, which on most architectures, is 4. |
Re: . by mexzony: 3:40pm On Nov 23, 2015 |
gimakon:I am not a c++ geek but the system should be able to implicitly convert an int to a float or vice versa. I think it returns the size of the number the answer in bits or something.my own guess |
Re: . by holyboss: 4:01pm On Nov 23, 2015 |
gimakon:The code is correct, run it with DEV or CodeblocK, It will display 4 |
Re: . by holyboss: 4:02pm On Nov 23, 2015 |
Re: . by holyboss: 4:04pm On Nov 23, 2015 |
mexzony:Your contribution is appreciated, bro.. |
Re: . by holyboss: 4:04pm On Nov 23, 2015 |
Diakon:Thanks man. Yal dah bomb! |
Re: . by holyboss: 4:05pm On Nov 23, 2015 |
gimakon:Thanks man |
Re: . by holyboss: 4:07pm On Nov 23, 2015 |
codemarshal08:It has been answered, thanks |
Re: . by holyboss: 4:23pm On Nov 23, 2015 |
Ezechinwa: Thanks Man |
Re: . by tdayof(m): 8:23pm On Nov 23, 2015 |
holyboss:hmm |
Re: . by holyboss: 3:38pm On Nov 24, 2015 |
(1) (Reply)
[updated] Kpntunnel VPN Works For MTN Mpulse Data / What Are Factors To Consider When Hiring A Software Developer? / Programming: Where Do I Start From
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 26 |