Thread: Command: $ cb file1.c > file2.c

  1. #1
    Registered User
    Join Date
    Sep 2001

    Command: $ cb file1.c > file2.c

    Could anyone explain how to use the following command:
    $ cb file1.c > file2.c

    I'm suppose to write a program to read input from file1.c and write the output to file2.c My lecturer insisted us to use this command and I have no idea how to use.

    My program is as follows:

    /* To calculate the sum of 1/(x*x) */
    int i,n;
    float sum;
    $ cb file1.c file1.c > file2.c
    scanf("%d", &n);
    for (i=n, sum=0.0;i>0;i--)
    sum += 1/((float)i*(float)i);

    printf(out,"Sum=%f\n", sum);


    I had tried inserting the command directly as you can see into the program but when I compiled the following errors appeared:
    try.c: In function `main':
    try.c:13: `$' undeclared (first use in this function)
    try.c:13: (Each undeclared identifier is reported only once
    try.c:13: for each function it appears in.)
    try.c:13: parse error before `cb'
    try.c:18: `out' undeclared (first use in this function)

    Please help. Thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    > cb file1.c > file2.c
    This is a command you type in at the command line to tidy up your code. It has no place inside the code itself.

    Just delete this line from your source code and try compiling it again.

    Example commands
    $ gcc file1.c
    $ cb file1.c > file2.c
    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.

  3. #3
    Registered User
    Join Date
    Sep 2001

    Talking Thanks

    Thanks a lot, Salem

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. small -> big -> bigger -> bigger than bigger -> ?
    By happyclown in forum A Brief History of
    Replies: 9
    Last Post: 03-11-2009, 12:12 PM
  2. Resource ICONs
    By gbaker in forum Windows Programming
    Replies: 4
    Last Post: 12-15-2003, 07:18 AM