Can any one show me how to write the code in C when I want to read the content of a text file and write it into a string?
Thank you!
User Profile
Collapse
-
print text file into string
-
hi Ganon11 !
after reading your suggestion then I 've corrected them
about Null : I just ignore it . :)
about malloc
it now is
that's all I could do.
and then I compiled. It worked :but it run incorrectly with the delete function.( because of the return I ignored ?
definitely I need more reading about C
... -
oh , thanks.
one more please :)
after I fix that one , anothers occur :
In function `int n_delete(dlist* , int)':
67 [Warning] converting to non-pointer type `int' from NULL
In function `dlist* get_node()':
87 invalid conversion from `void*' to `dlist*'
Leave a comment:
-
Doubly Linked List
can you please spend a little time evaluating this code.
I can not run it successfully
thanks :)
...Code:#include<stdio.h> #include<conio.h> #include<stdlib.h> #define SIZE 10 typedef struct dlist { int val; struct dlist *next,*prev; }*dll; //---------------- FUNCTION SEARCH_VAL -------------------------------------- dll search_val(dll -
the "wonder of google" told me that you are taking the same course with me . I knew who you are :) .
well , I guess that many others who " google" this excercise may come across to this forum :)))
I also found the key for the excerisce 2 in some corners of the net and I will post it here . have a look :
::Posting answers is like spoonfeeding code, so it was snipped::
they didn't explain...Leave a comment:
-
I definitely might have heard of and even witness the miracle of GOOGLE.
But rather than wandering tens or thoundsands of pages be4 stopping at what i need, some experiences of yours may help me speeding up my learning.
Recommendations and advices are always valuable to me .
I’m a little bit upset when asking someone and receive an answer : “Google it ”
Of course i dare not bother you( or waste my question...Leave a comment:
-
I’m not good at math at all. So don’t laugh at me if I think simply like this :
1. int x^2= x*x;
2. int x^4= x^2*x^2;
3. int x^8= x^4*x^4;
4. int x^16= x^8*x^8;
5. int x^62;
6. x^62 = x^2 * x^2 * x^2 * x^4 * x^4 * x^8 * x^8 * x^16 *x^16Leave a comment:
-
my book is "data structure and algorithm" by ALFREDV.AHO ...(1983)
I don't know why i'm learning C but the coursce book ( that book ) is in Pascal .
could you recommand some books of this subject in C ? ( I mean some links that I can download ;)...Leave a comment:
-
-
about the ex.2 ,
the greater the value of 150Nlg2N and N^2, the more slowly the program run.
so just compute and compare the 150NlgN and N^2,
with small value of N (N<100),
4 example, N = 2^6 = 64
150NlgN = 150*64*lg2^6=15 0*54*6
N^2 = 64*64
we see 150NlgN > N^2 so A run slower than B
by constrast, with N>10.000 150NlgN < N^2 so A run faster than B
is...Leave a comment:
-
really?
i've read it and I find it so difficult :( .
I do not understand the lecture much.
the due date of these ex. is Friday (midnight)
i'll read the lecture note again and try to do them.
if I can not do them or need some helps , I will ask you all again on Thursday.
thanks. yes , you'r rite, I should do by myself first :)...Leave a comment:
-
Analysis Questions...
if anyone know, plz help me
1.Show that X^62 can be computed with only 8 multiplications .
2.Programs A and B are analyzed and found to have worst-case running times no greater than 150NlgN and N^2, respectively. Answer the following questions, if possible:
1. Which program has the better guarantee on the running time, for large values of N (N > 10,000)?
2. Which program has the better guarantee on the...
No activity results to display
Show More
Leave a comment: