is there a good guide someone can point me to?
I'm trying to learn from my lecture notes, but they aren't very descriptive.
my books don't mention them neither.
Type: Posts; User: ktran03
is there a good guide someone can point me to?
I'm trying to learn from my lecture notes, but they aren't very descriptive.
my books don't mention them neither.
I'm reading a pdf on it, and so far it looks pretty much like c, albeit I'm only 25 pages in.
(albeit? did I use that word right, it's my first time)
any book recommendations?
is it easy, say for someone who's isn't a pro at C?
i was programming a c file,
messing with fopen w
now the whole folder that contains all my c files, and the file I wrote to with the program, will not open.
any clues?
opps,
should be %s...but still get same error.
void printtofile(char **wrdhold, char *out)
{
printf("%s\n", wrdhold[5]);
FILE *f_out=fopen(out, "w");
if(f_out==NULL) {
googling right now...brb
so I spent the last 4 days writing this program on ubuntu, everything runs nice.
but on kubuntu it craps out with a segmentation fault....wtf?
the program is being marked on kubuntu, so am I...
quick question
how do I know if the file I'm opening is empty?
stupid things I always overlook. dam quotations.
k, gonna go reimplement the strcpy algorithm.
just tried
array[0][0] = 'ass';
I'm getting assignment makes pointer from integer without a cast.
what does that mean?
oh crap,
what am i thinking.
I have a little algorithm to strcpy, but it doesn't work.
i removed it, then just putting sentences in the 3d array to see if it's malloc'd correctly.
thnkx for quick response
char ***array = (char ***)malloc(26 * sizeof(char **)); // mallocing one dimension for each alphabetical letter.
for(i = 0; i <26; i++) {
...
*array[0][0]='ass';
this line gives me error , overflow in implicit constant conversion.
does that mean this line is wrong? or my malloc'ing is wrong?
got it,
removed these test values and it works. WICKED!!! making progress is wicked.
array[0] = "hellohjhjghjgjhgjhghjgjhgj";
array[1] = "world";
printf("%s\n%s\n", array[0], array[1]);
i just tested that after the malloc, so it must be big enough
oh crap, I think i know what's wrong
brb
edit, nm...that can't be it.
I was thinking the first number in the file was being held in buffer, then being strcpy'd.
but since I did a printf...
this is part of it
array[i] = malloc(sizeof (char) * 20);
yes, that's correct. The number of words is given in the txt file.
I've got it dynamically allocate the strings array, but am having trouble copying the temp variable 'buffer' into the array of...
I'm gonna go read up on fscanf a for a bit...
I'm gonna take it one step at a time. The assignment is pretty big, I'm trying not to overwhelm myself, chipping away piece by piece.
but task 1 is to get the words read into a string of...
thankx,
I'm gonna try to implement that.
but what's the difference between fscanf, and getc?
and when I use getc, how do I know I've encountered a white space, and therefore need to move...
yo why so bitter?
it is homework. If anyone remembers me from my posts on here, I never ask for code straight. I always ask people to point me in the right direction, so I can learn, and not just...
omfg, after 7 hours of pounding my head....I finally got it to read something in.
char string[5];
int i;
for(i=0; i<5; i++){
string[i] = getc(file);
...