Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: flex567

Page 1 of 9 1 2 3 4

Search: Search took 0.02 seconds.

  1. Re: non-static variable this cannot be referenced from a static context

    Can you explain what did I do wrong in this progam?
  2. non-static variable this cannot be referenced from a static context

    why do I get this message from the compiler for this program:


    DungeonTest.java:8: error: non-static variable this cannot be referenced from a static context
    DungeonGame d = new...
  3. Replies
    7
    Views
    402

    Re: Beginner's problems with generics

    I thought that println() can return 0, but even if it did, the compiler wouldn't throw an error?

    now it runs as expected:


    import java.util.*;

    public class BasicHolder<T> {
    T element;...
  4. Replies
    7
    Views
    402

    Re: Beginner's problems with generics

    I dont know, the entire line = 0?


    System.out.println(element.getClass().getSimpleName());


    or class String doesn't have getClass() method
  5. Replies
    7
    Views
    402

    Re: Beginner's problems with generics

    I fixed it now I get



    Exception in thread "main" java.lang.NullPointerException
    at BasicHolder.f(BasicHolder.java:8)
    at BasicHolder.main(BasicHolder.java:12)
  6. Replies
    7
    Views
    402

    Re: Beginner's problems with generics

    And why do I get error at runtime for this program:


    import java.util.*

    public class BasicHolder<T> {
    T element;
    void set(T arg) { element = arg; }
    T get() { return element; }
    void f()...
  7. Replies
    7
    Views
    402

    Beginner's problems with generics

    public static <T> T[] fill(T[] a, Generator<T> gen) {
    for(int i = 0; i < a.length; i++)
    a[i] = gen.next();
    return a;
    }

    What does the bolded symbol mean?
  8. Replies
    2
    Views
    402

    Re: import/package beginner's problems

    I solved this problem already, I thought this is a dead forum.
  9. Replies
    2
    Views
    402

    import/package beginner's problems

    I use terminal(newest JDK) in Ubuntu linux to compile source files. I Would like to compile these 2 files but when I try to compile them I get "package net.sssw.test does not exist..."
    In which...
  10. Replies
    13
    Views
    1,858

    Re: Problem with lists

    so every time you delete something with erase() iterator becomes invalid and you cannot increment an iterator anymore?

    from this webpage: http://www.cplusplus.com/reference/list/list/erase/ :
  11. Replies
    13
    Views
    1,858

    Re: Problem with lists

    Why this program crashes?



    #include <iostream>
    #include <string>
    #include <list>

    using namespace std;
  12. Re: Visual studio 2013 bug? no operator found which takes a right-hand operand

    oh I see, you can probably just delete this thread.
  13. Visual studio 2013 bug? no operator found which takes a right-hand operand

    I get Error this error. Did I miss something or is that some kind of bug?


    error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::string' (or there is...
  14. Replies
    19
    Views
    1,081

    Re: Debugger error - ftol3.asm not found

    so this is how this code looks in memory?

    char ar[2][4] = { { 'x', 'y', 'z' }, {'q', 'w', 'r', 't' }};
    http://i60.tinypic.com/rw6gbq.png
  15. Replies
    19
    Views
    1,081

    Re: Debugger error - ftol3.asm not found

    I can see that this line


    char ar[2][26] = { { 'x', 'y', 'z' }, {'q', 'w', 'r', 't' }};

    only initializes first 3 elements of the ar[0][26] and first 4 elements of the ar[1][26] others are 0...
  16. Replies
    19
    Views
    1,081

    Re: Debugger error - ftol3.asm not found

    why is that ? To me ar[0] is not declared nor defined.
  17. Replies
    19
    Views
    1,081

    Re: Debugger error - ftol3.asm not found

    offtopic question:
    why 2 different lines display the same output?



    int main()
    {

    char ar[1][26] = {'x'};
  18. Replies
    19
    Views
    1,081

    Re: Debugger error - ftol3.asm not found

    yes, actully I want just that. To remove multiple instances of chars.
  19. Replies
    19
    Views
    1,081

    Re: Debugger error - ftol3.asm not found

    should I put 'unsigned' before double, what is size_t, a class?



    the goal of the program was to delete double letters. Now program works. Here is the program:


    string...
  20. Replies
    19
    Views
    1,081

    Re: Debugger error - ftol3.asm not found

    what that means ?

    I had to click step over if I wanted to continue. Otherwise I would just get "ftol3.asm not found"
  21. Replies
    19
    Views
    1,081

    Debugger error - ftol3.asm not found

    I tried to use the debugger on this code. I putted break-point to the line 38 and soon after couple of step-ins I get the "ftol3.asm not found" error



    #include <iostream>

    using namespace...
  22. Replies
    34
    Views
    1,325

    Re: Account exercise - Inheritance

    I will take a step back and probably rewrite the whole program
  23. Replies
    34
    Views
    1,325

    Re: Account exercise - Inheritance

    but I am also initializing it(with balance = 1200) so I don't know why it has default value ?


    Account mike(1200, 0);
    Savings mike_s(1200, 0);
    Checkings mike_c(1200, 0);

    I know that...
  24. Replies
    34
    Views
    1,325

    Re: Account exercise - Inheritance

    not yet

    With the help of a debugger I see that may balance is 0 instead of 1200. Why is that?
  25. Replies
    34
    Views
    1,325

    Re: Account exercise - Inheritance

    #include <iostream>
    using namespace std;

    class Account{
    double balance;
    int day_in_month;

    public:
    Account(double initial_dep, int d) : balance(initial_dep = 0), day_in_month(d = 0) {}...
Results 1 to 25 of 212
Page 1 of 9 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center