83 Posted Topics
Re: Yes, $10/hour, and first 8 hours $50 additional, would be OK for me :) But seriously, use fgets, not scanf, for input. | |
Re: fclose is all you need to free a file pointer. About your pFile pointing still to the same place... pFile is just a variable, and no function can change its value, unless you give it as &pFile as argument, in which case that function should expect pointer to pointer as … | |
Re: Yes delay is necessary, because it gives time to the rest of the system and other programs, when your program doesn't need it. A delay less than 10 milliseconds (10 000 microseconds) makes no sense, and is never accurate, because the minimum amount of time which scheduler gives to a … | |
Re: Look, the c compilers are made to be fast, there are compilers which use only one pass for finding all the symbols. Now you call your "square" function before you define or declare your function, so the compiler knows nothing about your function when it processes your function call. So … | |
Re: For such things, look sometimes at freashmeat or SourceForge, there are many c programs, you likely can find there examples about whatever you are going to do. For example, Simple Generic Assembler [url]http://sourceforge.net/projects/sgasm[/url] This is a very simple assembler, seemingly made also without yacc or bison, written in c. | |
Re: I don't know, in general, c doesn't guarantee really much concerning the exact layout of the structure in memory. So, using memcpy for structures, is likely not so good idea... The only good way to copy structures in c, is member by member. Therefore certainly, if something can be implemented … | |
Re: Read this, especially FAQ [url]http://www.linux-usb.org[/url]. You can run your program after the device is plugged in, using the hotplug script. | |
Re: What you talk about is not called "parallel programming" but event-driven programming. Event-driven programming is common for graphical programs which use widgets and windows. I wrote a snippet using GTK [url]http://www.daniweb.com/code/snippet737.html[/url] where you can see how the event-driven program works. You can use GTK drawing area if you like, but … | |
Re: Well the easiest, if you have only one input file, is [code] gcc something.c -o something.exe [/code] But better is [code] gcc -std=c89 -Wall something.c -o something.exe [/code] This is for windows, in linux the executables usually have no extension, they can have, but exe in linux is kind of … | |
Re: I don't know such algorithms and don't think it's a simple problem. But if nothing helps, look at the gimp code and see how it's done there | |
Re: What are you doing? Why do you need to have all these objects as function parameters when you input them in that same function, and where are all these objects defined? If all these "characters" are indeed defined as character arrays with the length of at least two characters, and … | |
Re: In the linux kernel codingstyle it's written that "It's a _mistake_ to use typedef for structures and pointers". Using typedef for structures is always unnecessary, even in case of structures which refer to each other, but would make the code unnecessarily less clear. Write instead: [code] #define MAXSIZE 64 struct … | |
Re: I don't quite understand what do you want to do, but maybe using tab (\t) somewhere in the printf format string would solve your problem. | |
Re: I had no time to look at your data very thoroughly, so all i can say is that all that compiler has to do is to guarantee that your program works as it is written, ie all references refer to the right objects, the memory can be reallocated if this … | |
Re: Yes you can do that and source code is portable as well, gcc is Mac main compiler. And use GTK :) there is also GTK for Mac. Of course it would not work on Mac, when you use Windows API. Once dev-c++ had a package system, which enabled to easily … | |
Re: Why do you do that with signals, signals supposed to be only for some system events, use pipes, or sockets. And if you anyway use files, nothing would become slower when you use files to signal. | |
Re: int space [] is in effect the same as int *space, you can use one instead of another. | |
Re: It is that in standard C, you can only print the results line by line (you can also overwrite the line, but not go back). Therefore using only standard C, the only option is to print the board every move, which sometimes can be even quite satisfactory option, because when … | |
Re: Try to comment out the suspicious code, like that containing GTGetUniqueFileName, and see whether it works then. To comment out you may use something like #if 0 and #endif Or, try to temporarily substitude the suspicious code with something not suspicious. | |
Re: Debian, and some other linuces, have /proc directory, where is information about cpu, memory and devices. | |
Re: As much as i know, there are no system calls for doing all that in POSIX [url]http://opengroup.org/onlinepubs/007908799[/url] nothing about password expiry. All that can be done though with commands, again i'm not entirely sure whether all of these are POSIX. The shell script likely used commands, and it is not … | |
Re: For just making out the logic, you can simply print the board every move, you can do this in standard C. For any more complicated output, you need some console or graphics. For console, the most standard method is to use terminal escape sequences, but these don't work in Windows, … | |
Re: This was the most frequently asked question once in dev-c++ forum, and i'm the most sure this topic has already been discussed many times in this forum as well. Maybe the shortest answer, use only fgets for input, this is the only right function for input, as it restricts the … | |
Re: I think this should work, but i didn't test it, please do it yourself. [code] #include <stdarg.h> void stringstofile (FILE *filehandle, ...) { va_list vargs; va_start (vargs, filehandle); while (va_arg (vargs, char *)) fputs (va_arg (vargs, char *), filehandle); va_end (vargs); } [/code] | |
Re: Likely the best advice, look at the SourceForge... 19073 projects written in C, many mature, some just ideas... [url]http://sourceforge.net/softwaremap/trove_list.php?form_cat=164[/url] | |
Re: You don't have to understand the makefile, to use the video codec. It makes no sense to read the automatically generated makefile, then better learn autotools. It is very simple to use autotools for a simple project, but for bigger projects it's not that simple any more. They use autotools … | |
Re: gcc can compile the code for ARM processors, powerpc, and some others, it depends what processor your microcontroller use. In general, the most feasible way to program microcontroller, is still to test and compile the code for your microprocessor, and then write it into the chip. For testing the program, … | |
Re: You likely don't link your my.c anyhow. It depends on your compiler, like gcc main.c my.c -o main both compiles the modules, and links them, producing the executable main. This is similar for all compilers, but the problem is when you use some graphical ide, which is bad anyhow, but … ![]() | |
Re: All escape sequences which c89 standard defines -- a single-quote ' can be represented by ', " by \", ? by \?, \ by \\, form feed by \f, new-line by \n, carriage return by \r, horizontal tab by \t, vertical tab by \v, null character by \0, octal integer … | |
Re: It seems that you like to write some console/terminal applications. Please try to understand me now. Standard C doesn't provide any features for that. Yes it's somewhat stupid to be able to write only some command-line programs, for example, while learning C. But C standard library is anyway only a … | |
Re: Hi! I usually use mingw [url]http://www.mingw.org[/url], as this uses a linux compiler gcc, and is therefore very reliable and complies to standards more than any other. It is easier to work with bigger projects using command line, and not so much rubbish files either. I use a vim editor [url]http://www.vim.org[/url], … |
The End.