Command: $ cb file1.c > file2.c

This is a discussion on Command: $ cb file1.c > file2.c within the C Programming forums, part of the General Programming Boards category; Could anyone explain how to use the following command: $ cb file1.c > file2.c I'm suppose to write a program ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    2

    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) */
    #include<stdio.h>
    main()
    {
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    > 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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    2

    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 Cprogramming.com
    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, 06:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21