83 Posted Topics

Member Avatar for hus2020

Yes, $10/hour, and first 8 hours $50 additional, would be OK for me :) But seriously, use fgets, not scanf, for input.

Member Avatar for Aia
0
81
Member Avatar for mohammadalipak

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 …

Member Avatar for TkTkorrovi
0
1K
Member Avatar for tu_m.aimes

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 …

Member Avatar for ashishtrivedi
0
214
Member Avatar for grii_19

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 …

Member Avatar for Aia
0
815
Member Avatar for amitbhat

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.

Member Avatar for amitbhat
0
122
Member Avatar for acchao

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 …

Member Avatar for Salem
0
634
Member Avatar for letmec

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.

Member Avatar for letmec
0
119
Member Avatar for chota

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 …

Member Avatar for TkTkorrovi
0
100
Member Avatar for pranay500866
Re: .exe

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 …

Member Avatar for TkTkorrovi
0
98
Member Avatar for danielbasten

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

Member Avatar for Salem
0
62
Member Avatar for DeathEvil

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 …

Member Avatar for Aia
0
97
Member Avatar for asilter

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 …

Member Avatar for Ancient Dragon
0
123
Member Avatar for DeathEvil

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.

Member Avatar for DeathEvil
0
122
Member Avatar for asilter

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 …

Member Avatar for asilter
0
130
Member Avatar for Firestone

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 …

Member Avatar for John A
0
109
Member Avatar for echobase

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.

Member Avatar for TkTkorrovi
0
180
Member Avatar for Firestone

int space [] is in effect the same as int *space, you can use one instead of another.

Member Avatar for narendharg
0
122
Member Avatar for tahnan

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 …

Member Avatar for Salem
0
130
Member Avatar for ananda6359
Member Avatar for mohammadalipak

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.

Member Avatar for mohammadalipak
0
154
Member Avatar for Covinus

Debian, and some other linuces, have /proc directory, where is information about cpu, memory and devices.

Member Avatar for Covinus
0
136
Member Avatar for kxh29

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 …

Member Avatar for TkTkorrovi
0
123
Member Avatar for vaibhavbhardwaj

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, …

Member Avatar for vaibhavbhardwaj
0
98
Member Avatar for wonder87

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 …

Member Avatar for Aia
0
124
Member Avatar for hitesh_mathpal

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]

Member Avatar for TkTkorrovi
0
205
Member Avatar for tiyagu_vpm

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]

Member Avatar for TkTkorrovi
0
73
Member Avatar for rpjanaka

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 …

Member Avatar for TkTkorrovi
0
122
Member Avatar for Anoop Dogra
Member Avatar for egboy

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, …

Member Avatar for egboy
0
316
Member Avatar for DeathEvil

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 …

Member Avatar for iamthwee
0
268
Member Avatar for aasi007onfire

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 …

Member Avatar for TkTkorrovi
0
105
Member Avatar for tasomaniac

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 …

Member Avatar for TkTkorrovi
0
710
Member Avatar for Dani

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], …

Member Avatar for tamilblast
0
732

The End.