Skip to main content
cst1992's user avatar
cst1992's user avatar
cst1992's user avatar
cst1992
  • Member for 9 years
  • Last seen more than 2 years ago
awarded
awarded
Loading…
revised
Loading…
Loading…
Loading…
awarded
comment
AngularJS controller to fetch and display employee data from database
Also, it's my hunch that the statements like vm.error = error; that are calls to functions aren't needed unless the view has something that uses them, such as ng-submit. Internal calls can be made to the functions directly.
revised
Loading…
awarded
Loading…
revised
Loading…
Loading…
comment
Min and max of numbers read from a file
Agree. I haven't used DevCpp in a while; I either use Netbeans or Eclipse or plain Vim and gcc. Also, I don't know why, but DevCpp has abysmal error messages.
comment
Min and max of numbers read from a file
Your post seems to be incomplete. Please complete it.
comment
Min and max of numbers read from a file
It seems the OP is using DevCpp. That's the only place where I've seen system("PAUSE") being used to wait for the user. I'm unsure whether getchar() works or not.
awarded
Loading…
comment
Find the largest exponent x such that p^x evenly divides n
@user3789184 The sole purpose of n and p here is to be passed to the method. The arguments are passed by value, meaning copies are made that are used in the method body. The original nand p are unchanged from the getExponent method. So it just wastes memory to assign values of n and p to a variable. An exception is when you have to declare them as constants similar to C's #define where you define them as const in the main public class.
comment
Find the largest exponent x such that p^x evenly divides n
@ErickWong Yes, that's exactly what I interpreted that to be. Also the fact that 162 is denoted as 2^1 * 3^4. I imagined 324, for example, would be represented as 2^2 * 3^4.