6,741 Posted Topics

Member Avatar for scrapper777

Are you sure it should accept negative numbers? The bitwise operators are tricky when working with signed types.

Member Avatar for Tight_Coder_Ex
0
174
Member Avatar for susiestudent
Member Avatar for Narue
1
101
Member Avatar for computerages

>the best thing to do is use visual basic, trush me is so easy Whether or not it's the best thing, the question was about C++ and posed in a C++ forum. Telling the OP to use VB is inappropriate. If he asked what language would be the best choice, …

Member Avatar for Narue
0
161
Member Avatar for Geek-Master

>lol I have yet to find a creative useful thing to use the old hardware for. Two words: battle bots. Two (or more!) desk chairs with castors, mountains of old hardware, plenty of duct tape, and a half-dozen brave interns makes for an entertaining day at work. :D

Member Avatar for Catweazle
0
194
Member Avatar for chanz

>void main is acceptable The language standard explicitly states that main must return an int. This has always been the case, except in the past the language has been imprecise enough for some to misinterpret it. Some compilers support void main, but only to cater to stupid people who don't …

Member Avatar for BountyX
1
233
Member Avatar for Tight_Coder_Ex

>would appreciate a practical example that is not taken from any theoretical text It's often useful to keep a reference count of how many objects are in existence at any given time. However, it's not always practical to have an object to call a member function on. Therefore, you need …

Member Avatar for Tight_Coder_Ex
0
135
Member Avatar for kimfalk

>Public means it's accessable to the outside world, but static limits it too the segment of code where you've declared it. You're mixing up your statics. :) static is overloaded for too many different uses. In a class declaration, static means that the name belongs to the class and not …

Member Avatar for prog-bman
0
491
Member Avatar for Fasola

It depends on the context. Typically, records vary wildly. A record could be the data content in any data structure or database, or it could be a string of characters between commas in a CSV file. In the context of your previous thread, a record is a line in the …

Member Avatar for Fasola
0
3K
Member Avatar for Chester1
Member Avatar for Narue
0
120
Member Avatar for jonnie83

I'm not surprised you're getting errors. Aside from the odd choice of using so many loops where one will do, you fail to close most of your blocks. Compare this with what you have and do try to learn from it: [code] #include <cstdlib> #include <fstream> #include <iostream> #include <string> …

Member Avatar for Acidburn
0
136
Member Avatar for roeschh2

[code] for(c=0;c<=100;c++) { if(!(inFile>>fname)) { break; } inFile>>prin[c]>>rate[c]>>pay[c]; } [/code] That looks suspicious. If the file only consists of rows with three numbers then trying to read something into fname will eat the first and every fourth number. Try this instead: [code] for (c = 0; c < 100; c++) …

Member Avatar for roeschh2
0
82
Member Avatar for apcxpc

1) The C++ standard library consists of everything (such as the C standard library) and the STL is an obsolete term describing the container classes and iterator based template functions supported by the C++ standard library. 2) [url]www.dinkumware.com[/url]

Member Avatar for Narue
0
98
Member Avatar for emguz

I don't think the C/C++ forum is the appropriate place for this question. Perhaps it's better suited to the Geek's Lounge.

Member Avatar for Narue
0
34
Member Avatar for hopeolicious

[code] #include <iostream> using namespace std; char menu() { const char *options[] = { "(e) enter invetory", "(p) purchase sode", "(s) sold soda", "(d) display inventory", "(q) quit", 0 }; char ret; for (const char **p = options; *p != 0; p++) cout<< *p <<'\n'; cout<<"Selection: "; ret = cin.get(); …

Member Avatar for Narue
0
199
Member Avatar for Khishin

>How can I take only the high order bit from that command? Here's a slight push in the direction of a solution: [code] #define bit(i) (1UL << (i)) [/code] You can use it to test a certain bit by ANDing the result of bit(n) with the value: [code] if ((GetKeyState(48) …

Member Avatar for Narue
0
129
Member Avatar for tommy_tucker198

>The best That's nice. Prove it. And anytime you say that something is the best or the worst, be ready to prove it.

Member Avatar for alsoagirl
0
183
Member Avatar for tuskyballer

>void main() This is not, and never has been, correct C++. The C++ specification requires main to return an int. >Never ever ever use goto stmts. Normally I'd call you a moronic conformist, but you've shown yourself to be fairly knowledgeable. So I'll give you a chance to argue your …

Member Avatar for Stack Overflow
0
715
Member Avatar for ohnbabygal

>typedef NutritionFacts Type; Header files don't magically know about each other. You need to tell them. For example, if node.h needs a name declared in nutritionfacts.h, you must include nutritionfacts.h [b]in[/b] node.h [B]before[/B] using the name.

Member Avatar for Dave Sinkula
0
111
Member Avatar for vtcedarpark@aol

j.random_newbie@aol wants code downloads, huh? Go [url=http://www.planet-source-code.com/]here[/url] and you'll find all kinds of good (but mostly crap) "code stuff". Enjoy.

Member Avatar for Dani
0
38
Member Avatar for moderate_rock48

Thank you very much. I had just managed to stop thinking about it and you reminded me. Now I hate you. :mad:

Member Avatar for moderate_rock48
0
83
Member Avatar for migthyjohn

[dripping sarcasm] Brilliant tutorial! I wonder how I've survived so many years as a programmer without reading "migthyjohn's frumph" tutorial. [/dripping sarcasm] >and i have yet to make any sense out of it Since you posted in the wrong forum, I get the impression that you don't read for comprehension …

Member Avatar for Siersan
0
117
Member Avatar for dallin

My first question is: why bother? Unless there's a trick that's slipped my mind, you need to copy the value into a string and then remove the first character: [code] #include <iostream> #include <sstream> using namespace std; int main() { double f = 0.123; ostringstream sout; sout<< f; string s …

Member Avatar for BountyX
0
127
Member Avatar for shonenhype

Piece 'O cake: [code] #include <cstdlib> #include <iomanip> #include <iostream> using namespace std; int main() { int n; cout<<"Height: "; if (!(cin>> n)) { cerr<<"Invalid input"<<endl; return EXIT_FAILURE; } for (int i = 0; i < n; i++) { cout<< setw(n - i - 1) << setfill('-') <<"" << setw(i …

Member Avatar for Narue
0
159
Member Avatar for ANRCCC

How do you know it's not doing something right? I'm not going to download an attached file with such an uninteresting name just to hunt down a mystery "it doesn't work" error. Be VERY specific about what your program should do, what you think it's doing, and what it's actually …

Member Avatar for Narue
0
116
Member Avatar for labomba1424

>Do not use a loop. Smack your teacher, he's an idiot. >ask three yes or no questions and a binary search to discover the answer. Do you know how binary search works? You start in the middle and divide the range by half for each yes or no answer. For …

Member Avatar for Narue
0
94
Member Avatar for xplst

Try this: [code] g++ -o sock_test sock_test.cpp -L/usr/local/lib -I/usr/local/include/Sockets [/code]

Member Avatar for grymse
0
3K
Member Avatar for missy

You want help with errors yet you don't use code tags and you don't tell us what the errors are. All I get when I compile are warnings that suggest inaccurate behavior. These statements: [code] avg[i]=n+m+p/3; davg = sum/3; [/code] Should be changed to this: [code] avg[i]=n+m+p/3.0f; davg = sum/3.0f; …

Member Avatar for Narue
0
115
Member Avatar for xsxixtxhx

>i can't get how to get it to work Wow, that's an impressive description of your problem. I think I'll just ignore you since you were rude enough to require everyone to download attached files.

Member Avatar for kc0arf
0
237
Member Avatar for sidhjn

[QUOTE=Dave Sinkula][url=http://www.daniweb.com/techtalkforums/announcement.php?f=8&announcementid=2]We only give homework help to those who show effort[/url][/QUOTE] Feh, you'd think people would be linking to one of my posts by now. ;)

Member Avatar for Narue
0
147
Member Avatar for ITman
Re: help

>can any one give me C program for ROUND ROBIN ALGORITHM No, do your own homework you lazy bum. >please needed urgently You should also learn not to procrastinate until the last minute.

Member Avatar for ITman
0
115
Member Avatar for ah01

Using global variables makes your code harder to follow. But I immediately found this error: [code] for (int x = 1 ; x <= number_students; x++) [/code] Why are you starting with 1 and ending at number_students when the array only goes from 0 to number_students - 1? This is …

Member Avatar for vegaseat
0
176
Member Avatar for chound

What happens when the length of the string is less than the index you're removing from? Show me this hypothetical algorithm to it's logical conclusion. For example, remove 'e'. Then remove 's'. Then what?

Member Avatar for Narue
0
210
Member Avatar for gal05
Member Avatar for chound

[QUOTE=chound]What are the params for find() and erase()?[/QUOTE] Some stuff with a couple of types. Google for dinkumware and do your own research.

Member Avatar for vegaseat
0
177
Member Avatar for Geek-Master

system returns an implementation defined value, if it returns at all. Try something along these lines instead: [code] #include <cstdlib> int main() { std::system("date /t > example.txt"); std::system("time /t >> example.txt"); } [/code]

Member Avatar for Geek-Master
0
125
Member Avatar for 40ounce68

>I read the book, but have a hard time applying it sometimes That happens at first. Programming is a very difficult activity, and anyone who tells you otherwise probably hasn't done much of it. >Programming profession or developing( is this the same as programming )? It depends on who you …

Member Avatar for Narue
0
97
Member Avatar for toffeeman2002

>it automatically quarantined the viruses Good. If you're not able to detect and quarantine Netsky then your virus protection sucks. >Can I block them? Yes. >Or even crash their computers if I have to No, that's illegal. You can block a sender, but most of the time this is a …

Member Avatar for caperjack
0
58
Member Avatar for evilsilver

>yes you can asign them with =, try this Brilliant Holmes, nice memory leak you've got there. First you assign memory to a pointer, then you reseat the pointer to a string literal, thus losing a reference to the memory you just allocated. You need to figure out the difference …

Member Avatar for jimFan
0
137
Member Avatar for SquirrelProdigy

>FlushConsoleInputBuffer() is used to prevent input from echoing, correct? No. >I reposted this because it looks like my text on the other post was made too small. It looked fine to me, maybe you just reposted with an annoying font size because everyone was ignoring you.

Member Avatar for SquirrelProdigy
0
370
Member Avatar for Sam Lehman

>i thought it was c++ was like java, where the funtions can be below main. They can be if you prototype them.

Member Avatar for Sam Lehman
0
158
Member Avatar for 40ounce68
Member Avatar for Alfarata

>This assumes that the user has some kind of brain. You mean the hypothetical imaginary user that university professors use to avoid teaching students the reality of error checking? I've never met such a user in real life. >you have to detect the period character in the entry string with …

Member Avatar for Narue
0
233
Member Avatar for potential

Yes. To return a vector of strings, for example, you would do this: [code] vector<string> function(); [/code] To return a pointer to a vector of strings, you would do this: [code] vector<string> *function(); [/code] To return a vector of any valid type, you would do something like this: [code] template …

Member Avatar for potential
0
105
Member Avatar for Tomas Lopez

Give an example of the output you're getting, preferrably at each call to insert. An initial test shows everything to work just fine, but I had to guess on the contents of list.h.

Member Avatar for Tomas Lopez
0
173
Member Avatar for dal4488

>but how do I find the number of yards, feet and inches in the user input? [url]http://www.thetipsbank.com/convert.htm[/url]

Member Avatar for Narue
0
103
Member Avatar for notdumb

Okay, I guess the problem [b]wasn't[/b] painfully obvious even though I pointed it out [b]to the line![/b] You're trying to terminate your switch statement with a while condition. That's a syntax error. Change this: [code] } while (done = !true); } [/code] To this: [code] } } while (done = …

Member Avatar for Narue
0
118
Member Avatar for notdumb

What a display of putrid formatting! Kudos for digging your own grave by trying to be concise. Here's your program with better formatting. Notice how the error is painfully obvious now (even without my red highlighting ;)): [code] // Will Urban CS 161 2/11/05 // Assignment 2 #include <iostream> #include …

Member Avatar for notdumb
-1
168
Member Avatar for seeplusplus

>Be nice to people, either answer their Q's or simply dont make fun of them, please. <NOPOST> Analyzing... Dave Sinkula: 583 posts Known guru Nice and helpful Intel: 11 posts Does not seem very bright Nice and gullible Conclusion: User "Intel" tries to act smart and pretend he knows what …

Member Avatar for Narue
0
172
Member Avatar for ehab_aziz2001

Why on God's green earth are you using K&R syntax? As for printing strings with fprintf, use %s, but make sure that the string is terminated by a null character ('\0') or you'll have issues.

Member Avatar for Narue
0
144
Member Avatar for eastgate

>my lecturer told me local variable is better than global hence increase data security That's an odd choice of advantages. Most people say that global variables are bad because they increase coupling between functions, make reuse harder, cause problems with multithreading, make the code harder to follow in general because …

Member Avatar for eastgate
0
621

The End.