Search:

Type: Posts; User: JohnGraham

Page 1 of 9 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    35
    Views
    2,794

    You are not - your movefunction() acts on the m1...

    You are not - your movefunction() acts on the m1 and m2 you pass it (i.e. in this case, the ones declared in your main() function), so you're okay on that front.

    However, the exercise states that...
  2. Replies
    10
    Views
    1,436

    I'm not sure you can quite get away with that,...

    I'm not sure you can quite get away with that, but you can come fairly close - instead of trying to use U, just call it a vector. Downside is you'd have to specialize for other containers, but by...
  3. Replies
    7
    Views
    1,374

    I don't know what you intend to show in your...

    I don't know what you intend to show in your example, but it doesn't appear to bear any relation to point 3. Also, you should make it clear where you get that point from - is it something you are...
  4. Replies
    7
    Views
    1,374

    Erm... you gave the example in your first post......

    Erm... you gave the example in your first post...



    Here you access the same object through both 'q' and 'p'.

    Can I ask what the end-goal is here?
  5. Replies
    9
    Views
    738

    Adak is indeed correct in that this will give the...

    Adak is indeed correct in that this will give the best performance (assuming you can allocate all the memory in a contiguous block at once). Not only will you do just one malloc(), you also may...
  6. Replies
    7
    Views
    1,374

    Yes, this is undefined behaviour - qualifying 'p'...

    Yes, this is undefined behaviour - qualifying 'p' with 'restrict' says that all accesses to the object pointed to by 'p' in that block will be through 'p' or the result will be undefined. However,...
  7. If you provide examples of which inputs it's...

    If you provide examples of which inputs it's wrong for - and the expected vs. actual output - it'd be a lot easier to troubleshoot...
  8. Fair enough - I stand corrected!

    Fair enough - I stand corrected!
  9. Replies
    4
    Views
    1,082

    No, it will not be lost - the memory remain valid...

    No, it will not be lost - the memory remain valid until either (i) you call free() on the pointer that malloc() passed out to you or (ii) your program exits.
  10. I don't know where you got that from - main() is...

    I don't know where you got that from - main() is just an ordinary function, and can be called from within a program just like any other. Granted it's not something I'd consider "normal" to do but...
  11. The main() function implicitly has C linkage -...

    The main() function implicitly has C linkage - that is, the compiler treats this:



    int main()


    As if you'd "really" written this:
  12. Replies
    21
    Views
    2,501

    Yeah, there's a speed comparison of SQLite, MySQL...

    Yeah, there's a speed comparison of SQLite, MySQL and PostgreSQL here. Note that (i) this is on the SQLite website itself, and (ii) it's for a relatively small database (14 MB), but it seems that...
  13. Replies
    3
    Views
    827

    This section from the C++ FAQ...

    This section from the C++ FAQ should answer any questions you have about virtual inheritance (but feel free to ask more specific ones if it doesn't).
  14. Replies
    15
    Views
    1,548

    Well, surely that would imply that as far as...

    Well, surely that would imply that as far as you're concerned it doesn't really matter, and you should just do either?

    For me, I find the distinction helpful when reading a function - using a...
  15. Replies
    2
    Views
    3,073

    Think about how you do numbers in school - to add...

    Think about how you do numbers in school - to add one, look at the digit in the 1's column and see if you can up it by one. Overflow? Reset it to zero and increment the digit in the 10's column....
  16. Replies
    15
    Views
    1,548

    Do whatever makes logical sense for your code to...

    Do whatever makes logical sense for your code to you as a programmer, then optimize if a profiler tells you that's too slow.
  17. Replies
    2
    Views
    968

    Your first three points are correct. You...

    Your first three points are correct.



    You already know what it is - it's the dereferencing operator. This statement is saying "take PINSEL_BASE_ADDR, cast it to be a volatile unsigned long...
  18. Replies
    2
    Views
    1,758

    I believe GStreamer can do this - just search...

    I believe GStreamer can do this - just search "GStreamer RTSP" and you should come up with a few examples. GStreamer is quite complicated, but it is very powerful.
  19. Yes, but that code will probably result in a...

    Yes, but that code will probably result in a segment violation - in this case, `p' should realy be `const char *' since initializing it like this may place the string in read-only memory....
  20. Replies
    40
    Views
    3,818

    I'm self-taught in C, C++, Java and Python...

    I'm self-taught in C, C++, Java and Python amongst other languages (I've never been taught computing/programming formally/by anyone else).

    As std10093 says, you can't really get to a point where...
  21. Replies
    10
    Views
    792

    Your problem is here: while (...

    Your problem is here:



    while ( (c=getchar()) !=EOF);


    Do not put the semicolon after the "while()" - if you do so, it constitutes the statement you want to perform, which does nothing. I.e....
  22. Replies
    5
    Views
    2,173

    Or use SCTP (http://en.wikipedia.org/wiki/SCTP),...

    Or use SCTP, which preserves both message boundaries (which TCP does not) and message order (which UDP does not).
  23. Now it seems that on my system the write is like...

    Now it seems that on my system the write is like two 2 B values getting swapped - i.e. writing like:



    *int_pointer_array[1] = 0xabcd1234;


    results in 0x1234abcd being read in printf(). Also...
  24. Okay, so here's what I've got after some testing...

    Okay, so here's what I've got after some testing - it appears all the writes are being "rectified" to be aligned to a 4-byte boundary, but the reads aren't. I don't know ARM assembler at all, so I...
  25. I get the correct output compiling for x86...

    I get the correct output compiling for x86 natively, but the exact same output as yourself when I cross-compile for ARM5TE.

    I think you're running into strict aliasing issues, but I'm not sure...
Results 1 to 25 of 201
Page 1 of 9 1 2 3 4