Thread: pls help proof read

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    1

    pls help proof read

    pls help me proof read for c prog. syntax errors. this is a basic c progam for synchonization between two computers on a parrallel virtual machine network.(hence all that pvm blah blah). Also i need corrections.

    Code:
    main()
    {
       int cc, tid, msgtag;
       char buf[100];
    
       printf("i'm t%x\n", pvm_mytid());
    
       cc = pvm_spawn("hello_other", (char**)0, 0, "", 1, &tid);
    
       if (cc == 1) {
            msgtag = 1;
          pvm_recv(tid, msgtag);
          pvm_upkstr(buf);
          printf("from t%x: %s\n", tid, buf);
       } else
          printf("can't start hello_other\n");
    
       pvm_exit();
    }
    these also:
    Code:
    #include "pvm3.h"
    
    main()
    {
       int ptid, msgtag;
       char buf[100];
    
       ptid = pvm_parent();
    
       strcpy(buf, "hello, world from ");
       gethostname(buf + strlen(buf), 64);
        msgtag = 1;
       pvm_initsend(PvmDataDefault);
       pvm_pkstr(buf);
       pvm_send(ptid, msgtag);
    
       pvm_exit();
    }
    Last edited by Ken Fitlike; 08-17-2006 at 04:55 AM. Reason: added code tags

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Read this entire thread, discover what you did wrong, and fix it.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > pls help proof read
    Well pls isn't a work.

    > this is a basic c progam
    Sentences begin with an upper case letter, and the C language is usually written in upper case as well.

    > synchonization between two computers on a parrallel
    More spelling mistakes.

    Some other stuff, but it's lunch time, and I'm hungry.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. read only folder on Windows
    By George2 in forum Windows Programming
    Replies: 2
    Last Post: 11-05-2007, 09:18 AM
  2. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  3. I am lost on how to read from file and output to file?
    By vicvic2477 in forum C++ Programming
    Replies: 4
    Last Post: 02-27-2005, 11:52 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Help! Can't read decimal number
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 09-07-2001, 02:09 AM