Where we have:
char vector[]
I want to do in an if-statement:
Type: Posts; User: porstart
Where we have:
char vector[]
I want to do in an if-statement:
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...
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...
That was it, thanks.
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...
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...
How would I assign values into large_cube[3][3][3]?
@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...
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...
thanks
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...
Thank you. I thought I'd already tried that ;\
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...
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,...
Thanks a million.
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....
Nevermind, sorry.
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...
Whoops, yeah that doesn't make sense.
Update:
Got it figured out; I need to dereference.
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...