Thanks itsqsd,
Havent had a chance to modify my code and test this yet, but ill post again when i do and let you know how i get on!
I cant see that i'll have any problems though ..
regards,
J@yb0t[afro]
Always know what you say, but don't always say what you know!
Hi all,
Im using gethostbyname() to resolve a domain name or IP but i am having trouble trying to return readable data from the member function h_addr_list[0]. Here is a code snippit of what im trying to do ..
struct hostent *he
.
if((he=gethostbyname(host))==NULL) {
exit(-1); /*exit on...
Hi m8,
Try checking the firewall log for entries with your servers IP address (/var/log/ipfw.log i think), type ..
#ipfw show - to see the current state of the firewall, to add rules use the following format ..
#ipfw add allow ip from <HOST> to any 2021 via any
#ipfw add allow ip from <HOST>...
Thnks Clairvoyant1332 - you certainly do poses some kind of physic abillity!!!
I had toyed with the idea of a signed/unsigned int but was not sure which struct to use to declare it.
Thanks again m8, u r a Star!
Jaybot[afro]
"Always know what you say, but don't always say what you...
Hi all,
in an attempt to exercise my socket programming/class writing skills, i have come accros a small problem in the class i am delevoping - it just a simple socket/server class under Unix (BSD).
my class is nothing to fancy and is derived from an old socket server/client program that i...
Hi all,
can anyone tell me if there are any restrictions on the 'types' that can be returned from within a function? i.e. (int, float, vector, ect.)
Yes, i have already posted another thread on the same subject, but what i need to know is how i can return an array if characters (char *) from...
hi yal'
Can anyone tell me the best way to return char* from a function/class method. All i need to do is return a string of chars when the func/method is called. I have also tried using ... string myClass::myMethod(void)... but no luck there either.
my code looks like this..
in class ...
Hi all,
Does anyone know how i could refernce a single character in an AnsiString, such as the one provided by the Edit->Text control.
I have tried variations on a theme, such as ..
char* name
for (i = 1; i <= Edit->Text->Length; i++){
name[\i] = Edit->Text[\i];
}
.. but the problem...
Hi all,
I am trying to use TcpCliet to create a small application to conect to my server (FreeBSD Unix) on port 25 (im not trying to send email, just using it for testing). I am used to doing this with Unix TCP sockets (c++) but with windows (XP) (c++ builder) I cant quite get the TcpClient...
Sorry mate,
got it working now! Another error was the reason it did not work!
Regards,
J@yb0t[afro]
"Always know what you say, but don't always say what you know!"
Thanks m8,
Tried that, but get the same result - any substring searched for returns 'found'.
Doesn't strstr() require all the chars of the main string and substring to be of the same CaSe?
This would not work for me as i have no way of knowing what case the main string (file) will be in...
Hi all,
I have written some code to open a file and check for a tag (string) within that file.
No matter how it is coded, the result does not appear to be correct. The code should return 'found' if the string was in the file, and 'not found' otherwise, but it does not appear to work...
Hi,
Smells like memory leakage!
Try changing ..
smiles = (char *)calloc(index, sizeof(char));
to ..
smiles = (char*)malloc(sizeof(128));
or
smiles = (char*)calloc(char,sizeof(128));
Regards,
j@yb0t[afro]
"Always know what you say, but don't always say what you...
Thanks Daniel!
Tried that but could not get it to work, ended up just copying all chars in the string but 1 (char by char cpy):
for(j=0; j < strlen(nulstr)-1; j++){
newstr[j] = nulstr[j];
Bit crude, but does the job.
Thanks anyway!
J@yb0t[afro]
"Always know what you say...
Hi all - can anyone explain how i could delete a character at the end of a string (char*), namely "\n". I have a function that gets the time ...
void GetTime(char *ti) {
time_t rawtime;
struct tm *timeinfo;
char *timedata;
time ( &rawtime ); /* Get the time */...
Thanks victorv!
I was not sure how to implement this at first and could not get things to work as i wanted, but then I tried setting up buffer like this..
buffer = (char*) calloc(128,sizeof(char*));
.. and got a result! Now i can do myVar = buffer; just before my assignment to effectively...
hi all,
heres a nuebie question for ya.. I'm trying to create infinite loop that continually assigns the results of some called functions to various variables, but i'm having a problem with re-assignment of the variables on the second loop? Basically I get a core dump!
Could anyone point me...
Thats great, Thanks!
Thats exactly what i was thinking of - struct s_stat - and well done! I didn't think anyone would get it from that criptic clue! [thumbsup2]
Regards,
JayB0t [afro]
"Always know what you say, but don't always say what you know!"
Hi all,
Can anyone recall the struct definition used to get a files creation times? (unix C++) I think the call is passed two arguments, one is the filename, and the other is this struc def; Not sure if this makes any sence!
Also, if you could provide an example of how it is used (defined) it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.