User Profile

Collapse

Profile Sidebar

Collapse
pxllyte
pxllyte
Last Activity: Nov 5 '06, 06:07 PM
Joined: Nov 5 '06
Location: Maryland
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • pxllyte
    replied to need help with a C program
    in C
    to get you started, you're going to be using a 2-dimensional array which will look like this by calling array[3][4]:

    then you'll use for loops to put numbers into each array element and then you can do the calculations...
    See more | Go to post

    Leave a comment:


  • pxllyte
    started a topic Read an input file into a single string
    in C

    Read an input file into a single string

    The input file data size is unknown so I would have to use malloc( ) to allocate enough memory for the file data. In order to do this, I would need to read each character of the file possibly by using a counter and then returning the counter as "totalChar" and allocating memory for it. The code I have so far is:

    Code:
    #define FILENAME_SIZE 15
    #define FILESIZE_MAX 10000
    
    char filename[FILENAME_SIZE];
    ...
    See more | Go to post

  • pxllyte
    started a topic Open, Read, Print an input file
    in C

    Open, Read, Print an input file

    I'm a beginner for C programming. For a part of my project, I have to take an input file from the user and be able to print it onto the screen. This is what I have so far:

    Code:
    char filename[10];
    
    FILE *ifp;
    printf("Enter the name of the file to analyze :");
    scanf("%s", filename);
    printf("\n");
    
    ifp = fopen(filename, "r");
    if (ifp ==
    ...
    See more | Go to post
No activity results to display
Show More
Working...