cheers mate....
Type: Posts; User: slowprogrammer
cheers mate....
here's how i declared text:
char text[LENGTH][SIZE];
//This is done in the main function...
Text is basically and array where i copy the file i open into...
well the compiler says:
In function 'main'
error: passing argument 2 of 'READ_FILE' from incompatible pointer type
In function "READ_FILE":
error: control reached end of non-void function
...
Hey i am trying to make a function to open the file but am having trouble. The original code looks lie:
fp=fopen(argv[1], "r");
if(text==NULL) {
EMPTY_FILE(1);
...
um im not really sure what a regex engine is....
BUT what i have done is separate the command "search M.orning" into two string. If the first string is equal to "search" it starts to look for a...
In my program i have a 2D array of strings and i want to implement a search function that can handle wildcard characters...
For example the array has:
Hello
Good Morning
Hello
Good Evening
...
wow i never imagined that my post would get so much interest...
If i had a string:
search apple
and i wanted to copy just "apple" into another string, i would be using the strcpy function but for some reason the code i am using doesn't compile properly...
ohhhhh of course.....I can't believe i didn't think of that.
Thanks a lot though
i guess i am living up to my username...
I have been using strstr to find a string within a string but there are some small questions that i wanted to clear up...
In this code:
char string1[]="red dwarf in the string";
char...
ok so what you are suggesting is that when search is typed in, the program initializes another array called search...
then it scans in the input presented by the user into this array...
Um i...
Hey i have a program that reads the contents of a file into an array...now i want to extend this program so that when i type in search "word" it prints out the line in the text that has the "word in...
Why do people have to assume that any question that is posted up is related to an assignment????
Im currently doing a duke of ed course and one aspect of it requires that i need to learn a new skill...
Hey guys Im slowly starting to learn C and i was quite interested in this problem...
If i entered a line of characters say a sentence how would i be able to print out the reverse of the input. Eg...
i sort of did figure it out.....
what i didn't tell you is that this program has a max elements of [1000][5] and the input to this program might be 10 lines or 50 or 100 so i have that counter that...
Hey im wondering what is wrong with this bubble sort code:
while (swapped){
swapped=0;
for(i=0; i<unsrtlen-1;i=i+1) {
if (array[i+1][4]<array[i][4])...
oh right....i think i fixed it up...Here's what my code looks like now
#include <stdio.h>
int main (int argc, char *argv[])
{
int array[10000][5];
int i=0;
int j=0;
ummm i tried implementing that into my code and it complied fine however now my results are really messed up....
I made my array size [50][5] and then entered scanned in a file with 10 lines of test...
Ok so according to the man scanf the value of EOF (which is -1 right???) will be returned when input is stopped prior to what the maximum is....so if i place an EOF code line (which i do not know how...
OK so this is what i have understood so far:
the counter increments each time it reads one line of input...But why is it placed inside the first loop and not the nestled loop....(i might get it...
The input is going to be given like (./programname<inputfile)...
What i am not understanding is how EOF is coded....all the examples i have seen with EOF include components of C that i have not yet...
Ummmm i did read the FAQ it but I was not able to understand it fully...Ive only been doing C for a few weeks and some of the stuff in it was something i have not covered before...
From what i have...
Hey guys I need to write a program that reads in an input using 2Darrays and then format the input in a table......
I have been told that the maximum number of inputs will be 1000 lines....
So the...