im a programming noob, having trouble with arrays

This is a discussion on im a programming noob, having trouble with arrays within the C Programming forums, part of the General Programming Boards category; yup, that's right. im sure some of u out there will laugh and not open this thread. but for those ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    8

    im a programming noob, having trouble with arrays

    yup, that's right. im sure some of u out there will laugh and not open this thread. but for those who are willing to take the time. thanx.

    im setting up a two dimensional array and trying to place them into a chart

    Inventory Report

    College

    1 2 3 4 5 6 7 Size Total

    Small

    Medium

    sizes
    Large

    XLarge

    College Total

    Total Inventory


    this is the chart i have set up but i cant figure out how to input my arrays numbers into the chart

    #include <stdio.h>

    double Calc_total_shirts(void);

    #define COL_NUM 8
    #define SIZE 5
    #define row_num 10
    #define col_num 10

    main()
    {
    double row;


    int //sizes,
    college_num,
    size_total;

    int array[SIZE][COL_NUM] =
    { {5, 5, 10, 15, 20, 19, 18, size_total},//smalls
    {10, 15, 20, 25, 26, 27, 29, size_total},//mediums
    {12, 14, 16, 18, 20, 22, 24, size_total},//larges
    {3, 5, 7, 9, 11, 13, 15, size_total} };//x-larges, AND end of array

    printf("\n\t\t\t Inventory Report");
    printf("\n\n\t\t\t College");
    printf("\n\n\t\t 1 2 3 4 5 6 7 Size Total");


    for(row = 10; row <= row_num; ++row)
    {
    printf("\n\n\n\tSmall %d", array[0][0]);
    for(college_num = 0; college_num < COL_NUM; ++college_num)
    scanf("%d", &array[SIZE][COL_NUM]);

    printf("\n\n\n\tMedium");

    printf("\n\nSize");

    printf("\n\n\tLarge");

    printf("\n\n\n\tXLarge");

    printf("\n\n\nCollege Total");

    printf("\n\n\nTotal Quantity On Hand");

    plz, no criticism. i know that im a noob and im just trying to learn thanx

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    8
    gah...the chart got all fux0red

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by scoot
    gah...the chart got all fux0red
    Put code tags around the source.
    Do this with [ code ] /* source */[ /code ]
    Note: don't use spaces inside brackets.
    Code:
     then it will look like this
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Registered User
    Join Date
    May 2002
    Posts
    8
    thanx dood...and i think i know the problem, i dont have any sub-scripts. i missed two classes and this whole chapter, i pretty much screwed myself. still need to know it though

    so yea...disregard all my code lol...its pretty dumb, redoing it now
    Last edited by scoot; 05-07-2002 at 01:42 PM.

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Good to see you're sorting it out yourself.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  6. #6
    Registered User
    Join Date
    May 2002
    Posts
    8
    hehe, making progress, got it to do the first line...but not continue to repeat the other lines! lol god i sux0r

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function to read in two arrays
    By ssmokincamaro in forum C Programming
    Replies: 7
    Last Post: 11-12-2008, 07:59 AM
  2. Manipulating Character arrays in functions.
    By kbro3 in forum C++ Programming
    Replies: 11
    Last Post: 08-16-2008, 03:24 AM
  3. Replies: 7
    Last Post: 06-04-2008, 11:39 PM
  4. Noob having trouble storing strings
    By wiramu in forum C++ Programming
    Replies: 6
    Last Post: 12-26-2003, 06:22 AM
  5. arrays arrays arrays....
    By Jan79 in forum C++ Programming
    Replies: 1
    Last Post: 11-11-2002, 07:16 AM

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