Search:

Type: Posts; User: porstart

Search: Search took 0.01 seconds.

  1. Equivalence statement between string element and apostrophe in codeblocks

    Where we have:



    char vector[]


    I want to do in an if-statement:
  2. Replies
    3
    Views
    1,950

    Very helpful, thanks. len =...

    Very helpful, thanks.



    len = strlen(Global[i]; //include <string.h> if you don't have it already included
    if(Global[len-1] == '\n')
    Global[len-1] = '\0'; //overwriting and shortening...
  3. Replies
    3
    Views
    1,950

    sorting an array of strings

    i'm trying to sort an array of strings which I have declared globally. Each string is a number following by a word (e.g. 14 socks). I'm just interested in sorting by number as of now.

    I've tried...
  4. Replies
    9
    Views
    1,137

    That was it, thanks.

    That was it, thanks.
  5. Replies
    9
    Views
    1,137

    I discovered that, but I was waiting to post the...

    I discovered that, but I was waiting to post the error till I had time to work on it myself.

    it's a segfault on this line:


    res = strcmp(letters, base[x]);

    the variables involved have...
  6. Replies
    9
    Views
    1,137

    Program crashing as windows executable

    Hi,

    I made a program about ~4k lines on my university's server with text editor Pico and gcc compiler. It works perfectly on their linux based server, but when I e-mail it to myself and then put...
  7. Replies
    6
    Views
    2,793

    How would I assign values into...

    How would I assign values into large_cube[3][3][3]?
  8. Replies
    6
    Views
    2,793

    @tabstop I actually don't want graphics (I...

    @tabstop

    I actually don't want graphics (I should of stated that), at least not yet. I just want to have the logical representation in my code. The goal is to be able to put the strings together...
  9. Replies
    6
    Views
    2,793

    3d array of cubes?

    Is this possible?

    What I want to do is have a large cube composed of 27 smaller cubes (3 x 3 x 3, the same as a Rubik's cube). I want the cube to be fixed, so logically we would only see it from...
  10. Replies
    2
    Views
    941

    thanks

    thanks
  11. Replies
    2
    Views
    941

    Returns when a function calls itself

    Hi, I'm wondering what happens when a function is called from within itself and then hits a return within itself. Does it return to the spot of the function call (within the function) or rather to...
  12. Replies
    4
    Views
    1,549

    Thank you. I thought I'd already tried that ;\

    Thank you. I thought I'd already tried that ;\
  13. Replies
    4
    Views
    1,549

    I'm 90% sure memcpy isn't covered in my course. ...

    I'm 90% sure memcpy isn't covered in my course.

    Basically if I have a structure which I've filled, how would I swap the 1st index with the 2nd index for every member of the structure?

    So that...
  14. Replies
    4
    Views
    1,549

    Swapping the indices of a structure

    I'd like to do this for my selection sort.

    I can do it for a member of a structure, e.g. if STUCT info[] is a structure and name is a string member of the structure:



    strcpy(temp,...
  15. Replies
    2
    Views
    1,822

    Thanks a million.

    Thanks a million.
  16. Replies
    2
    Views
    1,822

    Sorting an array of strings

    Hi,

    I can't figure out what's wrong with this code, but the selection sort isn't doing it's job (nothing gets sorted). I think there's probably a lot wrong with it, but I can't narrow it down....
  17. Replies
    1
    Views
    721

    Nevermind, sorry.

    Nevermind, sorry.
  18. Replies
    1
    Views
    721

    Integer as a cmd-line argument

    I'm looking ahead to stuff that's 2-3 weeks away for our course, so I only have textbooks/internet to go on, and so far I can't find this answer.

    How do I receive an integer as a command line...
  19. Replies
    2
    Views
    1,146

    Whoops, yeah that doesn't make sense. Update:...

    Whoops, yeah that doesn't make sense.

    Update:

    Got it figured out; I need to dereference.
  20. Replies
    2
    Views
    1,146

    Pointer comparison with negative integers

    Hello,

    WHen I try to make a comparison between a pointer and a negative integer, I get a compile error (it does not happen for identical comparisons where the sign is changed to positive).

    For...
Results 1 to 20 of 20