Recent content by Grep

  1. G

    Java Java error with variable initialization

    Lenient isn't always good. The compiler complaints usually are there for a reason. For example, the compiler is quite right here. If that Scanner(File) call throws FileNotFoundException in the first try/catch block, you just print something in the catch part. Now, between those 2 try/catch...
  2. G

    Programming newbie trying to learn C

    Expert C Programming: Deep C Secrets is such an excellent book. Highly recommended. I guess you could say it's an excellent second book on C.
  3. G

    [C] Errors passing bidimensional array to a funcion

    Oops, I meant n x n array. By that, I mean if n = 5, it would be a 5 x 5 array, for example. And you're welcome.
  4. G

    [C] Errors passing bidimensional array to a funcion

    You don't want the [][n] parts (and later, the [n]) when you actually call the function. Just during declaration and definition of the function. If it's an nxn function, I'd put the whole thing in the declaration and definition, e.g. int blah[n][n], just to make things as explicit as possible...
  5. G

    [C] Errors passing bidimensional array to a funcion

    Assuming this is C99 where variable length arrays are permitted, in short, it hasn't seen 'n' yet by the time you reference it with the array. The compiler is parsing the arguments left to right and needs to know what 'n' is in order to use it for the array. So put those variables before the...
  6. G

    Java Cant get the outputfile in Java program

    I see nothing wrong that would stop it from working. Plus, a quick test shows it creating the output file, for me. I think it's a matter of what the working directory is when you run it. That's where the file should show up. There's probably an output file created somewhere. You could try using...
  7. G

    How to Increment Hexadecimal Characters in C

    All numbers (generally speaking) are represented as binary inside the computer. What base you decide to use when displaying them is a separate thing. So really, if you want to increment a hex number in C, just use a variable with a numeric type to represent it, then print it out in hexadecimal...
  8. G

    [Xcode] Absolute value issue in C

    Let us look at one part of your code, and you should get how to handle the error condition for division once you know how to structure this code: First off, your indentation and formatting are really bad, and you need to improve that for many reasons, but for one, I find it hard to read...
  9. G

    My senior Project ( online website )

    I'd definitely start with SQLite. Far less setup, and you can be off and running with it quickly. And if you decide you want a more heavy duty database, it's not generally that difficult to change to another database. All the options I mentioned use SQL. You usually need to tweak a few things...
  10. G

    Java How Can a Beginner Tackle Learning Java and Android Programming?

    Don't get me wrong, I agree with you. I meant "3 or 4 years" to train up as a full software developer. And yes, most people who graduate still have a ways to go before they are really professional level. I stand by that. But you can certainly learn to use a language and some specific API in...
  11. G

    Java How Can a Beginner Tackle Learning Java and Android Programming?

    Try my book: Learning Java and Android Development in 3 easy lessons, and 7 very hard ones. (Little inside joke, lol.) In a couple of weeks? Why not learn Quantum Mechanics on your weekend, while they're at it. Totally unrealistic expectations, in my opinion, with no previous programming...
  12. G

    C/C++ Jamin2112 attempts C++ solutions

    Sure, you'll note that URL I gave you to the STL sort from <algorithm> contains an example bit of code that should make how to do it fairly clear, I hope. It's a really useful site that I use all the time. A very small and hopefully obvious change to their example comparator function should be...
  13. G

    C/C++ Jamin2112 attempts C++ solutions

    Be careful of letting the requirements frame your approach to the implementation. In this case, a vector (*cough*stopusingarrays*cough*) is very much a good idea. But if that range was very large and would result in a sparse array of counts, then you might consider something else like a map...
  14. G

    C/C++ Jamin2112 attempts C++ solutions

    That should be <cctype> and not <ctype.h>, if you'll recall from previous commentaries I've made on your code and using headers that come from C in C++. But you've got the idea. Just keep in mind, as previously mentioned, it is not locale aware, so make sure its assumptions are not violated...
  15. G

    C/C++ Jamin2112 attempts C++ solutions

    There's also a locale aware one in <locale>: http://www.cplusplus.com/reference/locale/isspace/. For removing whitespace, it works nicely with bind and the erase-remove idiom I already mentioned (using C++11).
Back
Top