560 Posted Topics

Member Avatar for pseudorandom21

I've been trying to make a reliable IRC client for a while now, and I know very little about sockets. I have read the RFC quite a bit, but programmatically responding when appropriate, and detecting errors still boggles me. How is the program to know the server will send three …

Member Avatar for pseudorandom21
0
155
Member Avatar for tsudeily

Search for record by student ID: [code] #include <iostream> #include <string> #include <fstream> #include <sstream> using namespace std; int main() { ifstream inFile; string result = ""; string id = "10364"; string line; inFile.open("records.txt",ios::binary); while( getline(inFile,line) ) { stringstream ss(line); if( ss >> result ) { if(result == id) { …

Member Avatar for thines01
0
228
Member Avatar for happygeek
Member Avatar for jammerjoe
0
1K
Member Avatar for Vasthor

Yes the variables you initialize in the body of the for-loop are local to the loop body's enclosing scope. I think that's written somewhere or something. In older implementations of C++ that was actually an option for Microsoft's compiler, probably even Version 6.0 of it. Heck there may still be …

Member Avatar for Vasthor
0
247
Member Avatar for ishaan3731
Member Avatar for pseudorandom21
0
2K
Member Avatar for maryam ahmad

Is the name of the file actually "Dictionary" or "Dictionary.txt" ? Also, with Vista above you actually can't read/write files in the root directory [noparse](C:)[/noparse] without admin priviledges. Run your project as an administrator and see what I mean.

Member Avatar for maryam ahmad
0
1K
Member Avatar for sbrohee

Hey if you're using linux why not give the C++0X threads a try? [url]http://www.cnn.com/video/?/video/cvplive/cvpstream1[/url] I don't know how to use the pthreads library or I would be able to help more, sorry :(

Member Avatar for sbrohee
0
310
Member Avatar for pseudorandom21

If ASIO had better documentation I could probably have found for myself an answer, but instead... Is there a way to determine bytes available to read using the asio::ip::tcp::iostream ? I really like the tcp iostream because it's super-easy to use, but I haven't found it exactly feature-packed. Does it …

Member Avatar for vijayan121
0
181
Member Avatar for pseudorandom21

It has occurred to me that there are very many factories in my area that use CNC (Computer Numerical Controlled) Lathes and other computer controller machinery. Is the operation of this machinery typically a job for a software programmer or does it require specialized knowledge? Is it worth doing with …

Member Avatar for jwenting
0
96
Member Avatar for kjs5533

Post your code inside the code tags: [noparse] [code] /* CODE HERE */ [/code] [/noparse] Also, please preserve the formatting (posting in the code tags will do that). You will need to copy it from it's original source again. Here's a tip for your "filler" function though, read a line …

Member Avatar for pseudorandom21
0
460
Member Avatar for vlaskiz

Will this help? C++ tokens: [code] #include <iostream> #include <string> #include <sstream> #include <vector> using namespace std; int main() { string line = " some tokens and a few 2349582346 2435 555 32 2 2 2 numb3r5"; stringstream ss(line); vector<string> tokens; string temp; while( ss >> temp ) tokens.push_back(temp); for(vector<string>::iterator …

Member Avatar for vlaskiz
0
119
Member Avatar for peter_budo
Member Avatar for WaltP
0
142
Member Avatar for Jdan2388

Initializing variables to zero. [code] float yards[32] = {0.0f}, passyards[32] = {0.0f}, points[32] = {0.0f}; [/code] If you're using visual studio you can set a "breakpoint" and debug the application. See the link in my signature for a youtube video on it. Chances are you aren't reading them from the …

Member Avatar for Jdan2388
0
261
Member Avatar for MediumSoda

Ctrl + X is sometimes a system command that may terminate or suspend the program. On windows it's probably Ctrl + C.

Member Avatar for MediumSoda
0
441
Member Avatar for mrnutty
Member Avatar for happygeek

I think this is a terrible event, since when is LulzSec anyone's enemy (besides the government)? They compromised the NASA website? Why?! LulzSec exposed a CIA botnet, why would the CIA have a botnet? Isn't this botnet preying on unsuspecting users? I don't want the CIA to have a botnet, …

Member Avatar for pseudorandom21
0
373
Member Avatar for harde

Last program of the class and you can't construct a for loop? [code] //Syntax: //for( ; ; ) //for( <initilization, normally a loop-control variable>; <test expression>; <increment/decement> ) //As such it follows that: for(int i = 0; i < 100; i++) cout << i << endl; //is a valid count-controlled …

Member Avatar for Schol-R-LEA
0
235
Member Avatar for pseudorandom21

[url]http://www.cnn.com/video/#/video/politics/2011/11/01/pkg-moos-perry-loosey-goosey-giddy-new.cnn[/url] This is hilarious (to me), but also potentially of concern for undecided voters or even Perry supporters, so I'd like to hear some feedback, what do you all think is going on with Rick Perry here?

Member Avatar for vegaseat
0
98
Member Avatar for pseudorandom21

I have a combobox I need to display some data in from a Database, but there are duplicates and I don't know how to select the distinct ones. Any help?

Member Avatar for pseudorandom21
0
223
Member Avatar for pseudorandom21

I have a form with a number of controls on it, and I had thought that the "Controls" property of the form instance contained all of the controls on the form as per the documentation. Actually it does, but now iterating over all of my controls becomes similar to iterating …

Member Avatar for darkagn
0
142
Member Avatar for eblanco1

instead of spaces or tabs use [b]setw[/b] [code] #include <iostream> #include <iomanip> using namespace std; int main() { cout << setw(10) << "First" << setw(10) << "Last" << endl; cout << setw(10) << "Somename" << setw(10) << "lname" << endl; cout << setw(10) << "Somename" << setw(10) << "lname" << …

Member Avatar for eblanco1
0
246
Member Avatar for resell4

[QUOTE=jwenting;1694037]Bill Gates money: school computers in African bush villages without electricity Michael Jordan money: 200mph capable Ferrari stuck in an LA traffic jam Both actual, Bill Gates donates a lot of money to organisations buying computers and medical supplies for developing countries, Jordan spends it all on expensive toys for …

Member Avatar for Netcode
0
328
Member Avatar for Goshutu

SDL_PollEvent returns 0 when no events are left to process, perhaps this happens more often than you realize? Also the nature of polling implies if you wait too long between polls (doing work in your switch) you may miss something.

Member Avatar for Goshutu
0
742
Member Avatar for johnnycock

Perhaps you would prefer to use an STL container like a deque or vector? [url]http://www.cplusplus.com/reference/stl/deque/[/url] [url]http://www.cplusplus.com/reference/stl/vector/[/url] Both containers appear to provide random access iterators and a dynamic size.

Member Avatar for pseudorandom21
0
129
Member Avatar for kingcong83

[quote][icode]void main()[/icode][/quote] Use [icode] int main() [/icode] or [icode] int main(int argc, char *argv[]) [/icode] as your entry-point, "void main" is not and never has been valid C or C++. [quote][icode]void DisplayBelowAverage( const string; const int[]; int, double);[/icode][/quote] replace ';' with ','. [quote][code]void DisplayPlayerData(playerNameAr[], scoreAr[], numPlayers)[/code][/quote] that is not valid …

Member Avatar for Schol-R-LEA
0
157
Member Avatar for hcw88

Post your code inside the code tags (available on most forums): [noparse] [code] /* code here */ [/code] [/noparse] For your "IsOperand" function there are some functions in <cctype> that you may want to look into using, particularly isalpha() and isdigit(). Alternatively you can build an alphabet as a string …

Member Avatar for pseudorandom21
0
173
Member Avatar for MadSeason

There are certainly some jobs in the CS department that don't involve programming. You know what they say, those who can't do, teach.

Member Avatar for Rashakil Fol
0
419
Member Avatar for pseudorandom21

Of course they will probably work out a solution, but what will happen if the U.S. government shuts down? [url]http://money.cnn.com/2011/11/18/news/economy/debt_committee/index.htm?source=cnn_bin[/url] What parts of defense and nondefense spending will be cut automatically? What about agencies like the CIA and FBI? What about military funding for the Army and such?

Member Avatar for jwenting
0
155
Member Avatar for pseudorandom21

If you or anyone you know is on the needy list this winter, you may want to sign this petition: [url]http://wh.gov/jyC[/url] Hey it's better than Obamacare and it might actually help some people.

Member Avatar for Ancient Dragon
0
60
Member Avatar for Despairy

I'm not sure I entirely understand your question. You would like to define a string constant, correct? [icode] const char *WARRIOR = "Warrior"; [/icode] -or- [icode] const string WARRIOR = "Warrior"; [/icode] [code] void play(char gameWorld[][BOARD_SIZE]) { Warrior war(1,1); int userChoice = getUserChoice(); string currentPlayer = WARRIOR; while(userChoice != 'q') …

Member Avatar for Despairy
0
155
Member Avatar for GrimJack
Member Avatar for Nikesh2014

Post your code inside of code tags: [noparse][code] /* code */ [/code] [/noparse]

Member Avatar for Schol-R-LEA
0
134
Member Avatar for Panathinaikos22

You can do that with a registry entry, the location fails me at the moment. Also you can use the task scheduler to do it (preferred).

Member Avatar for pseudorandom21
0
125
Member Avatar for alaa sam

I bought a book on C# and read most of it one day, the knowledge seemed to sort of sink in once I wanted to use C# for some small projects.

Member Avatar for alaa sam
0
123
Member Avatar for Xcelled194

If you wouldn't mind using QT I suppose you could try: [url]http://doc.qt.nokia.com/latest/qftp.html[/url] One word of advice, I would recommend using the QT installer on Windows, definitely. Alternatively there are other projects, [url]http://sourceforge.net/projects/poco/[/url] As for the command line arguments, as you probably already know [icode] char *argv[] [/icode] contains the command …

Member Avatar for L7Sqr
0
580
Member Avatar for armaan ali
Member Avatar for pseudorandom21

This is my first time trying to use a web API with C#, a friend asked me to make him a simple remote control app. I don't really know where to begin, I'm thinking I can create a [URL="http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx"]WebRequest[/URL] filled with the proper info, is this going to work? A …

0
90
Member Avatar for pseudorandom21

I have accepted an internship that involves re-writing a project written in "Clipper Summer of '87" in C#, and basically it's missing a couple source code files and I have no idea how to work with the database files it uses. I do know it uses something called "dBase III" …

Member Avatar for TrustyTony
0
304
Member Avatar for f4fjks

You could find some open source project that sucks and improve it. [url]www.sourceforge.net[/url]

Member Avatar for StuXYZ
0
121
Member Avatar for pseudorandom21

I have a database bound to a listbox but I would like to view only certain items, how to do that? It sounds like a really simple task but I don't know how to do it.

Member Avatar for pseudorandom21
0
106
Member Avatar for Hinnawi

[QUOTE=blud;1688646]Yeah, they definitely aren't up to spec with most enthusiast builds, but they are easily comparable to any computer you would find under $1k at a retail store.[/QUOTE] Except they're made to run Mac OS and Mac OS sucks, try maximizing a window or playing Quake III on it. Better …

Member Avatar for NicAx64
0
325
Member Avatar for pseudorandom21

If you're like me and enjoy Steam's service (not having to mess with DVDs and CDs), you may have purchased Skyrim through steam. Now if you're in the Americas and this category fits yourself, you might like to know all you need is an IP in a different country to …

Member Avatar for frogboy77
0
183
Member Avatar for ilovec++

{ case PC gaming: If the game supports my xbox 360 controller, I normally will use it. else, keyboard and mouse. case console gaming: not much choice } Recently I opted to upgrade my mouse & keyboard setup with a gameboard, it will arrive tomorrow and I'll let you know …

Member Avatar for ilovec++
0
920
Member Avatar for Dakot
Member Avatar for StuXYZ
0
183
Member Avatar for pseudorandom21

Is there any reason I'm missing as to why not many languages let a programmer create a table of constant information at compile time? Something like: [code] public const Dictionary<string,decimal> SOME_DICT = new Dictionary<string,decimal>( {"A", 1.9}, {"B",2.3}, {"C", 4.4444} ); [/code]

Member Avatar for thines01
0
136
Member Avatar for Acidburn

Wait what? Did I just hear the double quote is the escape sequence for quote? Whatever happened to: " \" " and " ' " ??

Member Avatar for nick.crane
0
2K
Member Avatar for Vasthor

I think it's asking you to fix the loop such that it doesn't print multiple spaces here: [code] // are we on the border? if (r == 0 || r == rows - 1 || c == 0 || c == cols - 1) cout << "*"; else cout << …

Member Avatar for Vasthor
0
359
Member Avatar for GrimJack

The gun law doesn't seem to be the issue, I support repealing the hughes amendment: [url]https://wwws.whitehouse.gov/petitions#!/petition/push-congress-repeal-hughes-amendment-fopa-and-nfa/FWXhjh9s[/url] The man knew what he was doing, it's his fault. Btw repealing the hughes amendment will make machine guns more affordable, currently you can get one but it will cost you thousands of dollars, …

Member Avatar for pseudorandom21
0
468
Member Avatar for flagstar

[QUOTE=crunchie;1646224]So, who plays Crysis2 multiplayer?[/QUOTE] Me! Man that game is beautiful, I bet BF3 will only be slightly prettier. Come to think of it I need some more RAM too. Other than that I have a small selection of Steam games, and I mainly play Counter-Strike: Source Beta. I would …

Member Avatar for jwenting
2
1K
Member Avatar for sknake

[QUOTE=sknake;1044348]This morning: Now: So one new person cast a vote .. and 28 posts went down. Someone had a busy morning :) I suspect if this were looked in to you would find Rashakil Fol behind it. The number of unique down voters went up by one, and my negative …

Member Avatar for pseudorandom21
2
964

The End.