i get a stupid seg fault when i try to open/read a file. all works well if the file == NULL and an error has to be printed, but it either just continuly loops or seg faults if the file is a good one....
Type: Posts; User: djwicks
i get a stupid seg fault when i try to open/read a file. all works well if the file == NULL and an error has to be printed, but it either just continuly loops or seg faults if the file is a good one....
ok thanx, ill put some effort in over the weekend and see where i get. :)
the funny y's are the empty spaces in the array. however this problem occurs because he is unable to find the end of file marker and set it to true to break the while loop.
HELP
what ck1 is getting at is what he is reading in is the following in a file:
123 Fake St Fakeville 3092
Flat 234 / 234 Greg Rd Melbit 2309[possibly space space space]...
so should i move the single string read in of "Heidelberg" into a temp string like FooString in ur example, then compare like u have done above quantim1024?
im a little unsure what result
if (...
what i want to do is to write my own string compare function because the built in doesnt work properly for me.
my two strings are:
char street_name[MAX][STR_MAX]
char...
thats great but i want to read from the input. so fgetc would clearly not work. right? anyway i must read it in as a whole line from the user input because it says i must.
how would this code work...
ok so i think ill use getch(). now if i were to read in this line of input:
"123 Fake St Melbourne 3000"
how would i do it and allow the user to see what they r typing at the same...
basically i have a struct with some various char arrays and ints. i have already used these throughout the program when reading from a file so i dont really want to change these.
anyway i ask the...
ok thanx for the help quzah
yes, it seems i must make my own string compare to do this. as it would be just 'to simple' to just call one built in function.
thanx once again quzah.
what i want to do is to compare the current read in string 'street_name' which has a single name then compares then reads a new name. And a previously read in string array in 'comp_street_name' which...
ok thanks again for ur help
regretfully, i think a lot of people missed my joke on the whole "HINT: u have a char c, so use it". apologees to anyone who thought i was serious about that. i just thought it was funny the way...
ok what im trying to do is to combine 3 bits of code that are exactly the same except for what the read in character is passed into.
firstly i read in from the file to a temp 'z', then do some...
ok what im trying to do is to combine 3 bits of code that are exactly the same except for what the read in character is passed into.
firstly i read in from the file to a temp 'z', then do some...
hahahahahahahhahaha, suttle, but still nasty as ever. :p
ok what im trying to do is to combine 3 bits of code that are exactly the same except for what the read in character is passed into.
firstly i read in from the file to a temp 'z', then do some...
great thanks swoopy, ive fixed it now.
thanx everyone, i've worked it out now. :)
essentially what im trying to do is to use one print-to-file function in two different ways. i have a print-to-error-file and a print-to-correct-file after i check some user input and i want to...
DONT WORRY EVERYONE, thanx to 0rion for his help in scoping. i got it. thanx so much
errrr, what more can i write? i want to pass in the global counter (st_name) to the function and plus one everytime i read a new line (the outside for loop) - count++. then once i have found the end...
ok im still going on my "read from many files in one function" but with another annoying problem (arent they all annoying!). anyway what i want to do is to read in a word, then increment my passed in...
THANKYOU so much, everybody who has cared enough to help.
:) :) :) :) :)