User Profile

Collapse

Profile Sidebar

Collapse
azzmosphere
azzmosphere
Last Activity: Jun 30 '11, 11:47 AM
Joined: Oct 9 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • azzmosphere
    replied to storage size of 'sin' isn't known
    in C
    I have been looking at the code but can't seem to get:

    sin.sin_addr = inet_makeaddr(
    inet_network("1 93.188.43.36"),
    inet_addr("193. 188.43.36"));

    line working. Don't know what is wrong here it looks correct? How did you go after you added the include file is it working on your system?
    See more | Go to post

    Leave a comment:


  • azzmosphere
    replied to storage size of 'sin' isn't known
    in C
    Hi I had a look at the program, are you using LINIX?

    if so try:
    #include <netinet/in.h>

    I believe you would probably find a few more errors downstream though
    See more | Go to post

    Leave a comment:


  • azzmosphere
    replied to i dont understand the use of cin
    in C
    I tried to compile this program using the following syntax:

    g++ filename.c -o filename

    Mainly because I couldn't see how it would work. C++ describes cin and cout as being able to split on a valid decimeter which it describes as a "a space, a tab character or a newline". Therefore the syntax:

    cin >> day >> ch >> month >> ch >> year;

    would not work...
    See more | Go to post

    Leave a comment:


  • azzmosphere
    replied to Unexpected behavior from Semaphore
    in C
    HI thanks for your response but I have figured out what is going wrong here. I had a look at tid1 and tid2 and re-read the man page fore pthread_create. From what I understand the command "pthread_create (&tid1, NULL, ThreadAdd, NULL)" will initialize tid1 to default values as the attr argument is NULL. The actual problem in the code was that MAC OS does not support POSIX style unamed semaphores but does support the older Mach style...
    See more | Go to post

    Leave a comment:


  • azzmosphere
    started a topic Unexpected behavior from Semaphore
    in C

    Unexpected behavior from Semaphore

    Hi I have been playing with a bit of code to teach myself how to use semaphores on my MAC OSX, however it does not appear to be working, here is a screen shot of what I am getting:

    1. The value of the semaphors is 0
    1. The value of the semaphors is 0
    Bad file descriptor mutex returned -1

    Here is the code that I have been playing with:

    #include <pthread.h>
    #include <semaphore.h>...
    See more | Go to post
No activity results to display
Show More
Working...