4,305 Posted Topics

Member Avatar for santa_barbarian

It looks to me that you are reading data into a buffer that does not get deleted at the end. Check your code for the ever so elusive buffer.

Member Avatar for santa_barbarian
0
184
Member Avatar for CNewbie

One way to do this, which is easiest on the user, is to extract the numeric content of the entry and go on. Here is a simple code snippet: [php]// A foolproof input routine for numbers: // The input string is analyzed for nondigit characters // which are removed, the …

Member Avatar for vegaseat
0
165
Member Avatar for hexonflux

I used to play around with Borland BGI graphic stuff more than twenty years ago, and am amazed that this thing still hangs around. When Windoze first came out, I learned to use the Graphics User Interface (GUI) and a bunch of API calls to do graphics. I am quite …

Member Avatar for alc6379
0
494
Member Avatar for Faramba

I hope this is not homework! That would be cheating! This will do something like that, learn from it: [php] #include <iostream> #include <iomanip> // for setw() #include <stdlib.h> // for system() using namespace std; int main() { int k; int scores[50]; // array to hold 50 integers // initialize …

Member Avatar for jwenting
0
148
Member Avatar for nowmn
Member Avatar for vegaseat
0
146
Member Avatar for Moo The Cow

Since you are writing a C program use getchar() to wait. [code]// you can also use just #include <iostream> // this works in DevCpp because iostream chain-includes down // to sdtio.h (not recommended for portable code) #include <stdio.h> int main() { printf("Hello, world!\n"); getchar(); // wait return 0; } [/code]

Member Avatar for harshchandra
0
155
Member Avatar for loveboy23

The getpid() function gets the (unique) process identification from the system. You need to include the process.h header. Beware, this function is not standard C. [code]#include <stdio.h> #include <process.h> int main() { printf("This program's process identification number (PID) " "number is %X\n", getpid()); printf("Note: under DOS it is the PSP …

Member Avatar for vegaseat
-1
116
Member Avatar for b3h_05

There is a DOS based tile game with mouse support written in Turbo C++, check: [php] http://www.programmersheaven.com/d/click.aspx?ID=F26995 [/php]

Member Avatar for jwenting
0
133
Member Avatar for skamen

How about this one? It's also in the C code snippets. I never knew it would work for anything below 1900, but it shows 01/01/1800 to be a Wednesday. [php]// function to return the day of the week given the date // Original Turbo C modified for Pelles C #include …

Member Avatar for vegaseat
0
2K
Member Avatar for Nyika

Try this, works well with the free Dev C++ compiler. [php]// display arrow characters with Dev C++ #include <iostream> using namespace std; int main() { char left,right,up,down; up = 24; down = 25; left = 27; right = 26; cout << up; cout << down; cout << left; cout << …

Member Avatar for vegaseat
0
1K
Member Avatar for Der_sed

You will not be adding up your total with something like =+ the correct operator is += Unless you have to use double return key, I would go with something as simple as t1 and flag down the 't' character to exit the loop.

Member Avatar for vegaseat
0
188
Member Avatar for paynekiller

This site has an example of eyes folowing the cursor. The program is for Visual C++ and is surprisingly simple. Download Tom and Jerry from: [url]http://www.cwinapp.com/tutorials/sourcecode/045.zip[/url] also look in the fun stuff section of this great website! There is enough English there to find your way around. It also gives …

Member Avatar for vegaseat
0
137
Member Avatar for nutwood33

The VB6 Working Model is floating around for almost free on a CD ROM with a number of books. I picked up "Sams Teach Yourself Visual Basic 6 in 24 Hours" at Borders for $19.99. The VB6 Working Model performs well, but lacks the help files. At least you get …

Member Avatar for nutwood33
0
130
Member Avatar for Der_sed

Just Extreme's code a little tidied up for Dev C++ Hope you can see the flow of things. [code]// Dev C++ code #include <iostream> using namespace std; int main() { int k, m; for(k = 1; k <= 10; k++) { // outputs 1,2,3,...,10 stars for(m = 0; m < …

Member Avatar for Der_sed
0
113
Member Avatar for Young Teck 06

You might want to look into Visual C++ Express. The beta version of this "student edition" is still free at: [url]http://lab.msdn.microsoft.com/express/visualc/[/url]

Member Avatar for vegaseat
0
366
Member Avatar for zack_rage

Take a beginner's look at: [url]http://gd.tuwien.ac.at/languages/c/programming-bbrown/cstart.htm[/url] The best way to get the hang of it is to write a few programs. There is also a great free C compiler at: [url]http://smorgasbordet.com/pellesc/index.htm[/url]

Member Avatar for zack_rage
0
177
Member Avatar for epsos

Take a look at: [url]http://gd.tuwien.ac.at/languages/c/programming-bbrown/cstart.htm[/url] At this point, don't waste your money on poorly written and mostly outdated books.

Member Avatar for epsos
0
186
Member Avatar for Tresa

You can look under Line and Curve Functions in the Win32 Programmer's Reference.

Member Avatar for Narue
0
119
Member Avatar for hopeolicious

The "undetermined character constant" was just one error. I fiddled with the code a little, take a look: [php]// student's grades Dev C++ #include <iostream> #include <ctype.h> // toupper() using namespace std; class student { private: char st_name[25]; char st_major[25]; int i_test1; int i_test2; int i_test3; int i_average; char ch_grade; …

Member Avatar for vegaseat
0
282
Member Avatar for vegaseat

I found this neat little GUI calculator program on the net. It uses a function called _gcvt(double val,int limit,string cBuf), which seems to be used to convert a double val to a string cBuf, with some formatting and limiting. I replaced it with sprintf(), but the output looks rather crude …

Member Avatar for vegaseat
0
301
Member Avatar for mister-fett

There is one site I like (black on white): [url]http://gd.tuwien.ac.at/languages/c/programming-bbrown/cstart.htm[/url] and just for reference and comparison of C vs C++ look at: [url]http://www.cppreference.com/[/url] Don't worry, most C++ compilers handle C just fine.

Member Avatar for mister-fett
0
138
Member Avatar for boshkash1986

Here is a little Delphi code that gives you just a hint: [code]// get the hard drive serial number (Delphi Pascal) procedure TForm1.SerialNumberButtonClick(Sender: TObject); var VolumeSerialNumber : DWORD; MaximumComponentLength : DWORD; FileSystemFlags : DWORD; SerialNumber : string; begin GetVolumeInformation('c:', nil, 0, @VolumeSerialNumber, MaximumComponentLength, FileSystemFlags, nil, 0); SerialNumber := IntToHex(HiWord(VolumeSerialNumber), 4) …

Member Avatar for vegaseat
0
116
Member Avatar for tsverrir

For a very detailed look at ListBoxes go to: [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listboxes/listboxes.asp[/url] Otherwise you have to write a little function to pad the string with spaces on the left.

Member Avatar for vegaseat
0
233
Member Avatar for kik786

Alfred E. Newman comes to mind with Mickey Mouse as vicemouse. Honestly, it doesn't matter, all these folks live in a different world! Dani would at least care about the younger folks.

Member Avatar for MikeAR
0
466
Member Avatar for lost_c++_dude

This will get close, looked it over in the morning ... [php]// This program calculates the total surface area of a pool wall // and estimated construction cost Dev-Cpp #include <iostream> #include <stdlib.h> using namespace std; int main(int argc, char *argv[]) { int depth,length,width,total; int surface; const double PRICE_SQ = …

Member Avatar for frrossk
0
421
Member Avatar for phr0stbyt3

There is a C code snippet in this forum under "Day of week given a date" that can give you an idea.

Member Avatar for Narue
0
119
Member Avatar for lost_c++_dude

Just a hint! Mixing up l and 1 are easy to do and hard to catch reading the code. I would use slightly more meaningful variable names like q and r. Also avoid using the often used i in loops and counters, it is another hard to read character, replace …

Member Avatar for vegaseat
0
120
Member Avatar for tionik06

double fmod(double x, double y) is a function, so you have to rewrite your code a little. It returns the remainder of the division x / y. Make sure to #include <math.h>

Member Avatar for vegaseat
0
149
Member Avatar for willow

Breaking out of a loop does not necessarily mean the use of the break statement. The way you wrote the while loop does it for you. [php]// exit a loop (Dev-C++) #include <iostream> using namespace std; int main(int argc, char *argv[]) { char answer; while((answer != 'Q') && (answer != …

Member Avatar for vegaseat
0
124
Member Avatar for dcving

[QUOTE=N3wbi3C0d3r]I tried to do something similar but much more simple, but i dont know what i did wrong. Wont compile it right. [CODE] //Clock for seconds #include <iostream.h> int main () { int HH; int MM; int SS; int result; cout << "Enter Hours :HH:"; cout << " "; cin …

Member Avatar for N3wbi3C0d3r
0
196
Member Avatar for Young Teck 06

[QUOTE=kakilang][PHP]#include<iostream> using namespace std; int main() { cout<<"Hellp World"<<endl; return 0; }[/PHP][/QUOTE] Freudian slip, do you want the world to hellp you, or do you think the world needs hellp? Anyway, cute!

Member Avatar for Young Teck 06
0
125
Member Avatar for kakilang

keybd_event() is a Windows API call ... The keybd_event function synthesizes a keystroke. The system can use such a synthesized keystroke to generate a WM_KEYUP or WM_KEYDOWN message. The keyboard driver's interrupt handler calls the keybd_event function. VOID keybd_event( BYTE bVk, // virtual-key code BYTE bScan, // hardware scan code …

Member Avatar for Narue
0
352
Member Avatar for dcving

Wow, variables and types are a mess here! Narue is right, the compiler will bitch! Oops, where did the structure type come from? Eric, doing this thing in small stages might help! Like your input section, comment out the other code, Compile and test each stage!

Member Avatar for Narue
0
138
Member Avatar for m-soft

Man, this gets my rusty brain working. exp(1/3*(ln(x))) gives you the cuberoot of x ln(x) can be found to the nth degree of accuracy via binary expansion and exp() via continued fraction expansion. This is a hint, go at it tiger!

Member Avatar for vegaseat
0
140
Member Avatar for dlh6213

This one is still looking for a name! Warning from the Department of Energy: There's a new computer virus on the loose that's worse than anything we've seen before! It gets in through the power line, riding on the powerline 60 Hz subcarrier. It works by changing the serial port …

Member Avatar for dlh6213
0
148
Member Avatar for Asif_NSU

Boreland has a very nice site to update help files: [url]http://info.borland.com/techpubs/borlandcpp/[/url]

Member Avatar for vegaseat
0
251
Member Avatar for tendekai

Get the Dev C++ compiler package from: [url]http://www.bloodshed.net/[/url] and the Pelles C compiler package from: [url]http://smorgasbordet.com/pellesc/index.htm[/url] Both are free and contain an IDE to write and compile your programs from.

Member Avatar for vegaseat
0
193
Member Avatar for willow

To get out of loop I have used the following macro: [code] #define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0) if KEY_DOWN(vk_q) ... [/code] vk_q is simply the ascci value of q

Member Avatar for vegaseat
0
175
Member Avatar for Sanirsanir

Pelles C is a complete system with an IDE. It is still very active, and best of all it's free. Download from: [url]http://smorgasbordet.com/pellesc/index.htm[/url] For something a little different you might want to download the BCX system, also free from: [url]http://www.rjpcomputing.com/programming/bcx/devsuite.html[/url] Look at BCX as a preprocessor for Pelles C (or …

Member Avatar for vegaseat
0
332
Member Avatar for BeyerCorpuz

To get your feet wet, go from basic to C/C++. I like BCX, a free basic to C translator. The generated C/C++ code that is then compiled. You don't have to get involved with C/C++ right away. However, if you want to be a programmer you should. BCX is the …

Member Avatar for pAiNtBaLlEr06
-1
467
Member Avatar for tendekai

This does look like C code. It looks to me like you are just reading one element of your data file. I would read this into an array and go from there. What does your data file look like? Are you simply writing the same file back out? This code …

Member Avatar for vegaseat
0
131
Member Avatar for Anu

This might help you with the arrow keys: [code]// trap the arrow keys // note: Pelles C uses _getch() rather than getch() #include <stdio.h> #include <conio.h> static int get_code ( void ); // System dependent key codes enum { KEY_ESC = 27, ARROW_UP = 256 + 72, ARROW_DOWN = 256 …

Member Avatar for vegaseat
0
230
Member Avatar for Jpowers22

[QUOTE=Narue]>I can't get anything to work on the hybrid version. Can anyone help, provide tips or pointers? Oddly enough, I posted the full implementation for an optimized quicksort in the code snippets on this site. One of the optimizations is terminating recursion on small subfiles and then calling insertion sort …

Member Avatar for subtronic
1
3K
Member Avatar for skywing

Simply draw a small circle or display the picture of a round button and make it respond to it's mouse_down event.

Member Avatar for vegaseat
0
150
Member Avatar for manos

I hope this is what you had in mind. The enclosed function evaluates a string like 123/3.1 or 12345679*63 and returnes the calculated value. Enter this string in your main() and call the function. [code] /********************* calc_val.cf ****************************** ** ** Parse a calculator string (eg. 5.7/3.2 or 4.2*9.7) for ** …

Member Avatar for Waskar
0
156
Member Avatar for hammy

[QUOTE=Narue][code] <a href="link" onMouseOver="document.image.src='on.gif'" onMouseOut="document.image.src='off.gif'"> <img src="off.gif" name="image"> </a> [/code] It's pretty simple really, onMouseOver and onMouseOut are events that are triggered when the obvious happens: the mouse enters or leaves the image boundary. document is the current HTML file, image is the name of the image we're working with, …

Member Avatar for hammy
0
377
Member Avatar for minnie

[QUOTE=minnie][B]Is it possible to convert from VB code to C and what is the best way to do this?[/B][/QUOTE] visit: [url]http://bcx.basicguru.com/[/url] and get a hold of BCX. Kevin Diggins migrated from VB to C/C++ a few years ago and wrote BCX, a basic to C translator that has been updated …

Member Avatar for vegaseat
0
437
Member Avatar for johnsonkek

I dusted off this little code snippet from the good old DOS days. It will answer some of your questions on how to calculate the musical scales. If you need any more details, get friendly with a musician! [code] /*********************** play.c *********************** ** ** Experimentation with sound: ** play(int octave,int …

Member Avatar for vegaseat
0
229
Member Avatar for kind4ever

[QUOTE=kind4ever]thanks alot cause Iam study this language at first time and its difficult and I wanna help to understand it and i ask you what is a pointer in c++ and how can work? plz explain to me[/QUOTE] There is a nice tutorial on pointers right here on DaniWeb. Look …

Member Avatar for Pikachu
0
188
Member Avatar for jaeSun

Here is some C code that might help you get started. [code]// A linear list of data accessed first in, first out (FIFO) is called a QUEUE. // Pelles C (vegaseat) #include <stdio.h> // in/out function header #include <string.h> // string function header #include <stdlib.h> // malloc() void enter(void); void …

Member Avatar for jaeSun
1
290

The End.