Search Results

Showing results 1 to 40 of 41
Search took 0.02 seconds.
Search: Posts Made By: nanodano ; Forum: C++ and child forums
Forum: C++ Apr 9th, 2007
Replies: 3
Views: 13,271
Posted By nanodano
Is there any way to read or write to a socket besides using the read() and write() functions. Is there any way to treat it like a stream and use the insertion/extraction operators (<< and >>)? The...
Forum: C++ Apr 2nd, 2007
Replies: 1
Views: 800
Posted By nanodano
I'm trying to create a general buffer that I can use in my program. It will work with ints as well as strings. So far I've been using a strstream, and it works without a hitch, but I was wondering if...
Forum: C++ Feb 14th, 2007
Replies: 4
Views: 7,642
Posted By nanodano
I found out the problem. It waits because it wants another program to handle the other end of the pipe.

I fixed my codes up and I wrote a script like this to fix the problem:


#!/bin/bash...
Forum: C++ Feb 13th, 2007
Replies: 4
Views: 7,642
Posted By nanodano
Hi,
I'm trying to write a program using named pipes, and I'm having trouble opening it. In another program I call this line:

mkfifo("./fife", 0777);


So my named pipe exists and I see it...
Forum: C++ Nov 20th, 2006
Replies: 10
Views: 4,629
Posted By nanodano
If you want to connect to your own network by going outside and coming back in you need to know your external IP address, and you need to tell your router to forward your port(1234) to your server...
Forum: C++ Nov 18th, 2006
Replies: 6
Views: 4,570
Posted By nanodano
This code snippet actually contains a few nifty things. There are two functions, hasVisited() and main(). hasVisited() makes use of a very handy function for CGI programmers: getenv. You can see I...
Forum: C++ Nov 11th, 2006
Replies: 14
Views: 2,665
Posted By nanodano
s.o.s.

Thanks for the clarification. I noticed that his was default initialized to 0 so i thought maybe it depended on the compiler. Now I know it only does that with global variables.
Forum: C++ Nov 10th, 2006
Replies: 14
Views: 2,665
Posted By nanodano
Hey,
In your printshippos function, you declare checkFlag at the top of that cpp file. When you initialize it like that w/o any number, it is either an unknown number, or in most cases, 0. The...
Forum: C++ Nov 10th, 2006
Replies: 14
Views: 2,665
Posted By nanodano
hey, would you mind posting your code of sending me your code? I'd like to see your working code just so I can study it.
Forum: C++ Nov 9th, 2006
Replies: 14
Views: 2,665
Posted By nanodano
I noticed too that you declare shippos inside an if block { } and try to refer to it in the next if statement, which is in a different block of code. That is probably why it prints out as 0+228...
Forum: C++ Nov 9th, 2006
Replies: 14
Views: 2,665
Posted By nanodano
Here is a link that might help you.

http://www.functionx.com/managedcpp/keywords/static.htm
Forum: C++ Nov 9th, 2006
Replies: 14
Views: 2,665
Posted By nanodano
I think the problem is because when you declare a variable static it affects the lifetime of it. You declare it inside the If brackets { }, so it will be destroyed at the end of the if statement....
Forum: C++ Nov 9th, 2006
Replies: 10
Views: 1,736
Posted By nanodano
I compiled your latter source code, and it worked fine. I could input the four numbers and it would give me output. You say it quits before it outputs the text? If you are using Visual Studio, if you...
Forum: C++ Nov 7th, 2006
Replies: 2
Views: 1,247
Posted By nanodano
I have a question and I was hoping someone could point me in the right direction.

I know the IP address of a server I want to download a file from, and I know the path on the client hard disk I...
Forum: C++ Nov 4th, 2006
Replies: 17
Views: 2,712
Posted By nanodano
I am a college student right now and I do almost all of my school coding with JOE on linux systems and compile with g++. I've also had to use Visual Studio 2003, which did make it easy to debug. I...
Forum: C++ Nov 1st, 2006
Replies: 11
Views: 2,956
Posted By nanodano
Ok, so I tried everything I could think of and tried everyone's suggestions. Finally, I just put it all into my main cpp file. It looks like this:

#include <iostream>
#include <vector>

class...
Forum: C++ Nov 1st, 2006
Replies: 7
Views: 6,011
Posted By nanodano
I like this snippet. I always find this kind of C++ code very useful.
Forum: C++ Nov 1st, 2006
Replies: 11
Views: 2,956
Posted By nanodano
Alright, I read the page a few times, and tested a few things and still I was frustrated. I decided to do away with the templates, because in my case I am only going to use it for int. I simplified...
Forum: C++ Oct 31st, 2006
Replies: 11
Views: 2,956
Posted By nanodano
I did try it, but no luck :sad: same errors.
Forum: C++ Oct 31st, 2006
Replies: 11
Views: 2,956
Posted By nanodano
Can I combine Queue.h and Queue.cpp into one file? I tried it, but I still get errors, so I'm not sure if that is allowed.
Forum: C++ Oct 31st, 2006
Replies: 11
Views: 2,956
Posted By nanodano
Hi,
I'm trying to write a simple Queue class, but I'm having trouble using it. It tells me I have undefined references to the functions I call in main.


// main.cpp
#include <iostream>...
Forum: C++ Oct 1st, 2006
Replies: 1
Views: 1,486
Posted By nanodano
When someone accesses a cgi script in their web browser is there a way to gather information, like IP address or user's web browser? I know how to read command line arguments, but I have a feeling...
Forum: C++ Oct 1st, 2006
Replies: 7
Views: 3,025
Posted By nanodano
Ok, for anyone interested, this is the entire mergesort program I was working on. It is finished and works(w/ g++). The stringstream issues I had were in the "GetInput" function. You will see how I...
Forum: C++ Oct 1st, 2006
Replies: 7
Views: 3,025
Posted By nanodano
Sorry for misunderstanding it. I got the problems all worked out now. Thank you all. =)
Forum: C++ Oct 1st, 2006
Replies: 7
Views: 3,025
Posted By nanodano
Thank all of you for your help,
I took all of your suggestions into account and made some changes in my code. Ancient Dragon, I took your advice on the string, which I think is more appropriate...
Forum: C++ Oct 1st, 2006
Replies: 7
Views: 3,025
Posted By nanodano
Ok, I have a small problem. I'm just trying to get my program to read a single line from a file at a time, and put the results in a vector.

The problem is at the end of each vector. It repeats the...
Forum: C++ Sep 29th, 2006
Replies: 1
Views: 2,503
Posted By nanodano
Hi everyone,
I have a simple setback in my program. I'm not the best way to go about doing this. I'm trying to do it in the simplest way possible. I have an input file that looks like this

2.5...
Forum: C++ Jun 12th, 2006
Replies: 14
Views: 3,326
Posted By nanodano
I have been writing some CGI scripts in C++, and I was wondering if anyone else has done the same? I have built a pretty decent sized library of functions I use a lot for formatting form inputs and...
Forum: C++ Jun 6th, 2006
Replies: 3
Views: 9,897
Posted By nanodano
This is a code snippet I wrote about keyboard input. It includes a demonstration of the arrow keys being read.

http://www.daniweb.com/code/snippet497.html
Forum: C++ Jun 4th, 2006
Replies: 3
Views: 1,099
Posted By nanodano
WolfPack is correct if you want to put the name of the file into your code. From the post, I read that you wanted to pipe a file into it. It would help if you posted your operating system. This is...
Forum: C++ Jun 1st, 2006
Replies: 4
Views: 2,467
Posted By nanodano
I'd like to add something (in case anyone is interested). An issue with the code I previously posted was that if there was a lot of time between calls to kbhit() and you only used one call to getch()...
Forum: C++ Jun 1st, 2006
Replies: 4
Views: 2,467
Posted By nanodano
Narue,

I looked up kbhit() and I read that it typically was a Borland Turbo C++ thing. Sure enough though, MS Visual Studio 2005 has a _kbhit(). It worked like a charm! The thing is, kbhit()...
Forum: C++ Jun 1st, 2006
Replies: 4
Views: 2,467
Posted By nanodano
I've been trying to solve this problem for a while now with no luck. I want to monitor an input buffer(cin) for a keypress. The catch is, I don't want it to hang if the buffer is empty. getch() and...
Forum: C++ May 25th, 2006
Replies: 12
Views: 7,603
Posted By nanodano
Hey zellex,

I wrote a connect 4 AI agent a while ago. You can play it at
http://students.csci.unt.edu/~jdl0107/conn4.exe

I know our code is different, but this is a link to my source code...
Forum: C++ May 24th, 2006
Replies: 5
Views: 2,754
Posted By nanodano
Mr. Sinkula:

Actually, I put the #define after the include statements. I moved it to before the includes, and it worked! I guess I thought that it would be better after the includes, that way it...
Forum: C++ May 24th, 2006
Replies: 5
Views: 2,754
Posted By nanodano
I'm writing a Win32 application for Windows XP with Visual Studio 2005. It is a console program, and I'm trying to find the HWND attribute of my console. I need this because I need to use it as a...
Forum: C++ May 23rd, 2006
Replies: 2
Views: 1,005
Posted By nanodano
Hey everyone,

I'm trying to write a simple program that can do more than one thing at once. I'm not an expert on the iostreams, so I don't know if I need to create threads to accomplish what I...
Forum: C++ May 19th, 2006
Replies: 1
Views: 4,641
Posted By nanodano
Hey,


I have a problem using Visual Studio 2005. In the MSDN library it says there is a function called SetConsoleDisplayMode. This function though is not in the 2005 library. I'm assuming...
Forum: C++ May 17th, 2006
Replies: 4
Views: 999
Posted By nanodano
Well, I'm not sure about everything you need to do in the program but there are a few things I noticed.

As the other reply says, your loop for the array should go from 0-4, not 1-5.

After all...
Forum: C++ May 16th, 2006
Replies: 9
Views: 6,846
Posted By nanodano
A good way of finding the highest of X number of integers is to use vectors, and to use the sort algorithm. They are both from the Standard Template Library STL. I'll give you an example of how to...
Showing results 1 to 40 of 41

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC