4,305 Posted Topics

Member Avatar for xfruan

Sounds like you want to sit down do some actual programming. Take some code samples from books or the code snippets here on DaniWeb and run them through your compiler. See what they do, then experiment with the code, improve and embellish. Read lots of books or online info while …

Member Avatar for xfruan
0
181
Member Avatar for Sphyenx

Heck, its an old thread, but I just discovered it! Here is my wooden nickel's worth. Python is an interpreted language. It has its origins in C, ABC and Modula2, and reads like pseudocode. It is very object oriented, just about everything is an object in Python. Yes, it is …

Member Avatar for vegaseat
0
245
Member Avatar for new comer

If you really want to learn C++ from a package deal I recommend this ... Get yourself the book "Standard C++ Bible" by Stevens and Walnum, published by Hungry Minds. This 800 page plus book is loaded with samples and comes with a CD-ROM containing all the samples and a …

Member Avatar for vegaseat
0
154
Member Avatar for trevs234

Windows GUI programming is not my métier, but I took the liberty and replaced #include "Skeleton.h" with #include <windows.h> Also replaced the two references to icon resources (hInstance, MAKEINTRESOURCE(IDI_SKELETON)) (hInstance, MAKEINTRESOURCE(IDI_SKELETON_SM)) with the more customary (NULL, IDI_APPLICATION) If you don't have the proper resource file, the reference to IDI_SKELETON and …

Member Avatar for vegaseat
0
161
Member Avatar for dani1982

First of all avoid the '\221' and '\222' and '\224' characters, the compiler does not like them, use ' or " where appropriate! Also use {"A", "Alpha"} and so on in your array of strings. Change ans to answer Once you get the program to compile you can work on …

Member Avatar for Tight_Coder_Ex
0
238
Member Avatar for nanodano

Darn, I have seen those little program codes float around and never saved one. You need to google, it should uncover one of them. Got to narrow it down from just "wallpaper" though, or you get 99% BS!

Member Avatar for vegaseat
0
105
Member Avatar for firion

There is a code snippet here on DaniWeb called "Plot a Sinewave to the Console" that addresses some of your concerns. Check out: [url]http://www.daniweb.com/code/snippet217.html[/url]

Member Avatar for vegaseat
0
103
Member Avatar for noyz
Member Avatar for vegaseat
0
75
Member Avatar for evilsilver

I think this is what WinBGI and this little code snippet is all about. [url]http://www.daniweb.com/code/snippet176.html[/url]

Member Avatar for 1o0oBhP
0
123
Member Avatar for billy-student

>I am new at programming and need help: #include <iostream> #include <cmath> using namespace std; int main() { int a, b, c, area, tri_area; area = tri_area(a, b, c); if area (area>0); cout << "Area is "<<area<<"!"<<endl; cout << " Those values tri_angle " <<endl; } double tri_area (double a, …

Member Avatar for Fasola
0
188
Member Avatar for JoBe

I think JoBe got it, folks are smart in Belgium! Just in case there are some stragglers, here is another twist to Dave's wonderful code. I am trying to make the whole thing more visible ... [php] // bitwise operations << shift left, >> shift right, & bitwise AND // …

Member Avatar for Fasola
0
443
Member Avatar for jonnie83

[QUOTE=jonnie83]I am having a problem with inputs. I can get the input using the cin command but i want to use the input to open a file with the inputs name ie the user types in FRED. cin>>name i want to open a file called fred.txt ifstream in("name.txt"); the above …

Member Avatar for vegaseat
0
108
Member Avatar for tenoran

Take a look at: [url]http://www.daniweb.com/code/snippet139.html[/url] It might just give you an idea.

Member Avatar for tenoran
0
135
Member Avatar for compshooter

The iostream header that comes with the Dev-C++ package does take care of ye system() function (through seemingly endless internal includes). Be aware that this is not true for other C++ compilers. They may require the cstdlib header. Also system("pause") is strictly a DOS call and is not portable to …

Member Avatar for vegaseat
0
153
Member Avatar for evilsilver
Member Avatar for scar_zone82

There is a code snippet called "algorithm uses in scheduling between RAM and CPU" at: [url]http://www.daniweb.com/code/snippet6.html[/url] It just might help you on your scheduling adventure.

Member Avatar for vegaseat
0
195
Member Avatar for tommy_tucker198

To someone just starting out, "free" may be best. Also a nice IDE, help and debugging may be very important. Just like with the best car, "speed" isn't all there is! Dev-C++ and the GNU stuff may not be a racehorse, but it is a good workhorse and it is …

Member Avatar for alsoagirl
0
183
Member Avatar for tuskyballer

[QUOTE=Intel]Oh man, you even don't know the down side of "goto" stmt in C++? Crab, well then i should not [B]waste my time[/B] replying to your posts.[/QUOTE] The much maligned goto statement has a good and healthy reason to be part of the language. One of the best reasons is …

Member Avatar for Stack Overflow
0
715
Member Avatar for Tom Pilk

Microsoft supplies the runtime version of .NET Frameworks freely, you will have to distribute that along with your executable file. At least that is my understanding. Eventually all Windows machines will have .NET Frameworks installed right out of the box. What a wonderful world that will be!!!!

Member Avatar for mcldev
0
152
Member Avatar for DaveSS

Dave, you need to change your input loop and call your functions when you want to calculate area, cost and price. On cursory look, this is what I would recommend ... [php] // David Shaw // Lab 3 - Functions // 02/18/05 #include <iostream> ///#include <iomanip> // not needed! using …

Member Avatar for DaveSS
0
122
Member Avatar for migthyjohn

You have the worst book ever written in the dummies series. This author couldn't write his way out of a paperbag was the opinion of one of the critics.

Member Avatar for Siersan
0
117
Member Avatar for jasweb2002

Fill us in on YACC and give us a Hello World! Does it stand for Yet Another C Compiler?

Member Avatar for vegaseat
0
129
Member Avatar for mrb260478

Might work for you, check this C snippet on DaniWeb: [url]http://www.daniweb.com/code/snippet64.html[/url]

Member Avatar for vegaseat
0
118
Member Avatar for roscioeak@direc

This would be an example of a stack of integers using a list ... // example of a stack (Last In First Out = LIFO) using a list // compares to a stack of dinner plates // Dev-C++ #include #include using namespace std; int main() { list iL; int k; …

Member Avatar for vegaseat
0
104
Member Avatar for ITman
Re: help

I can and will only give a hint, look at: [url]http://www.daniweb.com/code/snippet6.html[/url]

Member Avatar for ITman
0
115
Member Avatar for ah01

As Narue so kindly pointed out, you went past the array, that gets you into garbage values. There is also a casting problem with the variable validate. You may want to add checks for non-numeric input, or you get into strange loops! I don't have VC++ up, so I tested …

Member Avatar for vegaseat
0
176
Member Avatar for tones1986

frrossk did a great job helping you! Please put the following lines near the end of your code, just above return 0; to make the console display wait: [php] cin.get(); // trap return cin.get(); // wait till key pressed [/php] there are a couple of other things to be worked …

Member Avatar for bombe
0
602
Member Avatar for chound

use the two functions clear() and length() [php] string str1 = "Judges live on income"; string str2 = " fixed"; cout << "before clear: " << str1.length() << endl; str1.clear(); cout << "after clear: " << str1.length() << endl; // now do the same thing with str2 [/php]

Member Avatar for vegaseat
0
177
Member Avatar for 40ounce68

My son took the Deitel to college with him, sorry can't answer your many questions. A lot of them are actually answered in Al Stevens' Standard C++ Bible.

Member Avatar for vegaseat
0
106
Member Avatar for Alfarata

For simplicity sake let's use the perfectly unsafe gets() function. [php] ... char filename[80]; char extension[] = ".csv"; puts("Enter filename (no extension):") gets(filename); strcat(filename, extension); ... [/php] This assumes that the user has some kind of brain. If the user is brainless you have to detect the period character in …

Member Avatar for Narue
0
233
Member Avatar for dal4488

Just a hint, after doing Dave's corrections study up on the modulus operator % ...

Member Avatar for vegaseat
0
606
Member Avatar for eastgate

I took the liberty to show your first example to my students today as a masterpiece of bad coding style. This is what they came up with, modified to work on Dev-C++ and in acceptable style. Please look at it and learn!!! [php]// grading example Dev-C++ #include <iostream> using namespace …

Member Avatar for eastgate
0
621
Member Avatar for lrea_fallon

[QUOTE=lrea_fallon]I am a begging Assembler Student and I am having problems. When I run my program it is telling me I have a bad ASA control charecter. I have checked my program and I don't see anything wrong with it. Does anyone know what the problem could be?[/QUOTE] I would …

Member Avatar for lrea_fallon
0
95
Member Avatar for MissSneakyPaws

Most browsers leave a heck of a trail all over your drive, there is no escape! So use your best judgement what you are browsing for ...

Member Avatar for vegaseat
0
197
Member Avatar for dr.danno
Re: Help

I would say use HTML and a little JavaScript to change the cursor. Look at this code snippet here on DaniWeb to get a hint. [url]http://www.daniweb.com/code/snippet179.html[/url]

Member Avatar for vegaseat
0
88
Member Avatar for f_escobar82

The function is called CreateFont(), not something for the faint at heart! [php] HFONT CreateFont( int nHeight, // logical height of font int nWidth, // logical average character width int nEscapement, // angle of escapement int nOrientation, // base-line orientation angle int fnWeight, // font weight DWORD fdwItalic, // italic …

Member Avatar for kc0arf
2
4K
Member Avatar for tad73831

This is from the Borland site: rand() uses a multiplicative congruential random number generator with period 2 to the 32nd power to return successive pseudorandom numbers in the range from 0 to RAND_MAX. The symbolic constant RAND_MAX is defined in stdlib.h Typical example: [php] #include <stdlib.h> #include <stdio.h> #include <time.h> …

Member Avatar for evilsilver
0
352
Member Avatar for dr.danno
Re: help

Would be rather simple in HTML, but since you posted this in C/C++ I assume you want to get an idea in those languages. Check the code snippet "Mouse-over (rollover) effect in a Windows GUI program" at: [url]http://www.daniweb.com/code/snippet88.html[/url] You have to change the cursor in WinMain() and put the images …

Member Avatar for 1o0oBhP
0
133
Member Avatar for helmica

[QUOTE=helmica]hi all am having hard times since yesterday trying to solve this problem. Declare the following two integer lists: int a[] = {5, 8, 4, 1, 7}, b[] = {12, 3, 15, 6, 23, 1, 2}; int sizeA = sizeof(a)/sizeof(int), sizeB = sizeof(b)/sizeof(int); list<int> list1(a, a+sizeA), list2(b, b+sizeB); Use the …

Member Avatar for vegaseat
0
188
Member Avatar for dallin

Study up on printf(), particularly the width format specifier. Apply this to sprintf() within your function. Most help files that come with the compilers should give you all the details.

Member Avatar for Dave Sinkula
0
111
Member Avatar for wildkms725

[QUOTE=wildkms725]Thank you for you help. Is there any way that I can combine the two .cpp files into one?[/QUOTE] Just combine them in your editor. Put all the header files near the top and sort them out for duplicates. Also obvious things like #include "search.cpp" are not needed any more. …

Member Avatar for vegaseat
0
205
Member Avatar for vegaseat

Why are the standard header files in C++ so non-standard? Particularly iostream seems to be the most dialectal. Enough to make the whole language a mess to work with!

Member Avatar for vegaseat
0
146
Member Avatar for dallin

Roll your own, it's just too simple ... [php] if (number < 0) number = -number; [/php]

Member Avatar for Acidburn
0
98
Member Avatar for cricket

[QUOTE=Siersan]Using strchr it would look something like this. [code] #include <stdio.h> #include <stdlib.h> #include <string.h> int check(char str[], int search); int main(void) { char buf[BUFSIZ]; int ch; printf("Enter a string: "); fflush(stdout); if (fgets(buf, sizeof buf, stdin) == NULL) return EXIT_FAILURE; printf("Enter a character to search for: "); fflush(stdout); if …

Member Avatar for vegaseat
0
161
Member Avatar for dallin

When in doubt, use the old workhorse printf(). I have played around with manipulators like [php]cout << setfill('0') << setw(8) << d1; [/php] with results that cause only consternation. The old printf() like Chainsaw mentioned works well: [php]// right justified numeric output (Dev-C++) #include <cstdlib> #include <iostream> // may have …

Member Avatar for vegaseat
1
5K
Member Avatar for sinB

Take a look at the C or C++ code snippets here on DaniWeb ... The very top line of this page.

Member Avatar for vegaseat
0
84
Member Avatar for ysong00

Dave is right, increase your array dimension from 6 to 7. Actually your example ran into troubles with element 5 already. Here is the test code: [php]// a test of the morse code #include <stdio.h> // morse codes char m[57][7] = {".-..-.", "", "", "", "", ".----.", "-.--.-", "-.--.-", "", …

Member Avatar for vegaseat
0
96
Member Avatar for letmec

If you just want to view images, there is a simple C code snippet on DaniWeb: [url]http://www.daniweb.com/code/snippet86.html[/url] It's called "Displaying a JPEG image using Windows GUI", it will also display BMP and other images.

Member Avatar for dalaharp
0
607
Member Avatar for seeplusplus

Compare this code to your code and it will give you a hint why yours does not work. [php]#include <iostream> int order_chars( int*, int*, int* ); int main() { int c1 = 5; int c2 = 10; int c3 = 15; int* c1ptr; int* c2ptr; int* c3ptr; c1ptr = &c3; …

Member Avatar for Chainsaw
0
143
Member Avatar for JoBe

You may want to take advantage of STL set. [php]// the STL set is a sorted unique element container // Dev-C++ #include <cstdlib> #include <iostream> #include <set> // stl header #include <iterator> // ostream_iterator using namespace std; int main(int argc, char *argv[]) { set<int> iST; int num; cout << "Enter …

Member Avatar for JoBe
0
854

The End.