|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
file merger
Im writing a file merger mainly for concating phrack issues =P - but it compiles and doesnt wanna open files and keeps crashing =\ quite odd - if anyone can help would be appriecated - here is the code :
PHP Code:
NB: used PHP tags but its C |
|
#2
|
|||
|
|||
|
HI ALEN
Well i would help u if u werent such a newb
how found da best book on python, it called "core python programming" heard of it?? |
|
#3
|
|||
|
|||
|
one problem i can see at the first glance:
PHP Code:
you assign to the char*, but this makes "array" a local copy (!) in the scope of "readstdin()". you need to pass a pointer to the pointer or a reference to the pointer. eg. PHP Code:
or you can allocate the memory in the main function instead before calling readstdin()
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#4
|
|||
|
|||
|
hmm - I tried that but same thing: it gets the base file now and crashes when opening the file to be appended.
Plus one minute Dev-C++4 was throwing an error - d:\my documents\projects\untitled1.c: In function `main': d:\my documents\projects\untitled1.c:18: warning: passing arg 1 of `readstdin' from incompatible pointer type d:\my documents\projects\untitled1.c:25: warning: passing arg 1 of `readstdin' from incompatible pointer type d:\my documents\projects\untitled1.c:32: warning: passing arg 1 of `readstdin' from incompatible pointer type d:\my documents\projects\untitled1.c:39: warning: passing arg 1 of `readstdin' from incompatible pointer type d:\my documents\projects\untitled1.c: In function `readstdin': d:\my documents\projects\untitled1.c:62: warning: passing arg 1 of `strcpy' from incompatible pointer type - then iI compile again and it does, very odd. Also wondering if that is a problem why doesnt Dev-C++ catch it ? Last edited by empty : November 15th, 2002 at 07:46 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > file merger |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|