C help! Please - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: C help! Please (/showthread.php?tid=65968) C help! Please by .Roy on 09-08-2006 at 10:46 AM
#include <stdio.h> RE: C help! Please by Stigmata on 09-08-2006 at 11:09 AM
windows.h ? RE: C help! Please by Eljay on 09-08-2006 at 11:13 AM problem with delay being no such function exists? RE: C help! Please by .Roy on 09-08-2006 at 11:31 AM i remember when using turbo ++ delay did exist. RE: C help! Please by RaceProUK on 09-08-2006 at 12:00 PM
#include <stdio.h> RE: C help! Please by .Roy on 09-08-2006 at 12:09 PM
#include <stdio.h> RE: C help! Please by Plik on 09-08-2006 at 12:48 PM google says to either try includeing windows.h or unistd.h RE: C help! Please by .Roy on 09-08-2006 at 01:01 PM
>.> im using dev-C++ maybe it doesnt work with this i dont know ... RE: C help! Please by Adeptus on 09-08-2006 at 01:20 PM
I think the function you are looking for is named Sleep() with a capital S in MinGW library, and declared in windows.h -- try this: RE: C help! Please by .Roy on 09-08-2006 at 01:55 PM
quote:Thanks LOADS! ! Edit: And when i used turbo c ++ there was a command called gotoxy() where moves your pointer to the following coordinates, like gotoxy(5,30). and its not working, maybe i should just use turbo c RE: C help! Please by absorbation on 09-08-2006 at 02:54 PM
The problem is some compilers are different. At the end on the main function try adding this. For me the window opens and closes, so I think the basic solution would be adding this: RE: C help! Please by Adeptus on 09-08-2006 at 03:17 PM
quote:If you are going to want to do things like that (which may not seem much, but believe it or not, are not part of the "standard" library you can always count on), then it may be best to settle on one compiler. There are three parts to what you are learning: the C language syntax; the standard library, which is very minimal; interacting with the OS and hardware. The language and the standard library will be the same across different compilers. Support for interacting with the system beyond what is provided by the standard library will vary -- not just between operating systems, but even between different compilers. This is what you have been encountering. You may find this tutorial useful for your cursor positioning needs. If you need to anything relevant to Dev-C++, include the keyword "MinGW" in your query, as that is the name of the compiler and libraries behind Dev-C++. RE: C help! Please by RaceProUK on 09-08-2006 at 03:41 PM
quote:No it wouldn't, as the linker will just chuck away anything that isn't used. quote:If you wish to use the Windows Sleep function, yes. However, I believe the standard C library has a sleep() too, in unistd.h (I just Googled it ). And, as always, remember that different compilers and systems have different libraries. RE: C help! Please by absorbation on 09-08-2006 at 03:44 PM
quote: Dev-C++ is having some troubles with me at the moment doing that, Visual Stuido didn't, looks like I need to check my configuration or find the cause. Thanks It is pretty bad, a simple Hello World program seems to turn into 1MB in size, I need to fix it ASAP, it has only recently happened RE: C help! Please by Adeptus on 09-08-2006 at 03:57 PM
quote:This would be true where the full POSIX API is implemented. MinGW libraries, however, do not have it. I feel that was a wise decision on their part. While it would have been very easy to #define it to Windows Sleep() call, there are expectations for POSIX sleep() in regard to signal handling, which could not be met -- in other words, it would be broken. RE: C help! Please by .Roy on 09-08-2006 at 04:36 PM
I think im going to just use the program that our school uses. RE: RE: C help! Please by segosa on 09-08-2006 at 08:07 PM
quote: Try compiling it in release mode, not debug. RE: RE: C help! Please by andrewdodd13 on 09-08-2006 at 08:16 PM
quote: I believe the command for gotoxy(x,y) using windows.h is SetCursorPosition(int left, int top). I haven't ever used Dev-C++ - my school were nice enough to give me an old copy of VS6 until .NET 2005 express came out - so this command may not work. Just make sure you do #include <windows.h> first PS. Just checked, I don't think that command works in C. Use the following: code: RE: C help! Please by .Roy on 09-08-2006 at 09:48 PM Gah i always thought "C" was a scripting language that is the same with every program wtfux... RE: C help! Please by ShawnZ on 09-08-2006 at 10:02 PM
quote: C is a specification, not a scripting language. Functions are provided by libraries that come with your compiler, which allow you to use functions provided by the operating system you're using. |