Here's a quick and dirty way to do it using conio and getch. Substitute your own nonblocking read where appropriate:
#include <iostream>
#include <string>
#include <conio.h>
using namespace...
Type: Posts; User: Brighteyes
Here's a quick and dirty way to do it using conio and getch. Substitute your own nonblocking read where appropriate:
#include <iostream>
#include <string>
#include <conio.h>
using namespace...
>Any suggestions? thoughts? comments? How do I do this?
Not a bad problem, here's one way:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#define LOW 1
In MS Visual Studio, go to Tools...Options...Tabs. Set it up however you like from there.
>$Yea $right $gentle $boost $unless $you $talk $like $this.
I think anyone smart enough to figure out C++ would be able to catch on to scalar notation, don't you?
Then you are compiling as C, it's not legal code so you're sure to get a diagnostic when you try and compile. Try this instead:
FILE * fileP;
main()
{
char name[36];
fileP =...
>How are C++ and php complimentary?
PHP has similar syntax to C++ and is a gentle boost into the scripting world.
fgets(name, sizeof (name), fileP);
Though it looks like you're compiling as C++ since C doesn't support variable declarations except at the top of a block of code.
Use some flavor of getline:
string data;
...
getline(fin, data);
>Is there any reason that you chose to use size_t as opposed to int?
The function doesn't work with negative indices and size_t is to be preferred over int for array indicies if you can manage it.
...
She's probably attracted to you, but I wouldn't call it love. :rolleyes: Have you tried asking her for a date? If she says yes then that's typically a good sign. :p
You can try google, but this is a topic that some very large books are filled with. Maybe a trip to the bookstore would be better. :) I think Usenet has a comp.security group. I've never been there,...
>Can anyone suggest a way of improving the speed of this function?
Don't bother until you're sure that there's a performance problem. Optimizing this function would probably result in it being...
>while(!feof(datafile))
Bzzzt! This is wrong, look here to learn why.
>I swear to GOD! If this turns into a "Use opera! Use Mozilla" bull$$$$ thread, I'll stop coming here.
If you constantly blow up over such simple things then your not returning may be a good thing....
>Does your linked list has a pointer to the last node?
Not built in, no. I decided against it for simplicity sake, though you can easily place an iterator to point at the end of the list if you need...
>Oh hell.. :)
Would you like my double linked list library? That would save you a lot of work. ;)
It's in C though, for C++ the std::list would be way better.
DOS supports functions like that, though for modern Windows systems I'm unaware of something that simple. Most APIs for Windows support 3D and windowing and all kinds of nifty doo dads, nobody wants...
Always check for an empty list:
if (head)
head->prev = temp;
You were dereferencing a null pointer by saying head->prev on the first prepend. At that point head was null, so you got...
>Where?
Online somewhere, google it.
>How?
With great care. Garbage collectors are not simple and can be very tricky.
>I have never see one...
Probably because C++ as a language isn't suited...
>If so, what is the point of it?
Microsoft thought it up...that should tell you enough. ;) I've always been fond of this little gem from windows.h:
typedef WORD ATOM;
>If possible, can you avoid putting these on the site webmaster?
Why are you even using IE? Opera will block all of those annoying ads with a satisfying gusto.
char buff[BUFSIZ]; // BUFSIZ defined in stdio
while(fgets(buff, sizeof (buff), inp1)){
sscanf(buff,"%d %s %s %lf",&cAtom.num,cAtom.name,cAtom.symbol,&cAtom.weight);
fgets returns NULL on...
>No prob wish i knew code for MTing in c++ :S
It depends on what implementation of threads you use. pthreads can be used for Unix systems (check the man pages), or you can do it with Windows.
>search for a garbage collector
Isn't that a bit of overkill? You would have to suffer the detrimental effects of a garbage collector for the life of the program whereas simply making sure there are...
I have the C/C++ programmers bible, it's crap. :) Not only is it highly DOS based, the code is rarely correct and often dangerous. Want to buy my copy? I'm trying to get rid of it. ;)