User Profile

Collapse

Profile Sidebar

Collapse
dn6326
dn6326
Last Activity: Jan 17 '08, 06:26 PM
Joined: Sep 1 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dn6326
    started a topic Declaring global variables
    in C

    Declaring global variables

    hi, essentially, my program needs to store an array of lists so that in main() it can have 2 run modes from the command line.

    i.e. i can run the program with
    Code:
    ./matrix load filename
    to load a matrix into my array of lists
    then use
    Code:
    ./matrix find 1 3
    to do something to the matrix I have just made (which is an array of lists)

    i was going to create a global variable which was an array...
    See more | Go to post

  • dn6326
    started a topic Use of fscanf
    in C

    Use of fscanf

    Hi, basically im trying to read in a file that represents a matrix, where the first line is in the format of <number of rows> <number of collumns> then all lines after that follow the format
    <row> <col> <value> i.e. the file would look like
    2 2
    1 1 2
    1 2 3
    would represent the matrix
    | 2 3 |
    | 0 0 |

    im having trouble using fscanf to read the numbers into...
    See more | Go to post

  • dn6326
    started a topic Combining string and chararcter into string
    in C

    Combining string and chararcter into string

    hi again, basically i want to add a character c onto string s,

    so far ive tried s = strcat(s, c)
    but it says they are incompatable

    and i tried s = ("%s%c", s, c)

    but again no luck...

    any ideas?

    cheers
    See more | Go to post

  • dn6326
    started a topic bus error?
    in C

    bus error?

    can anyone tell me why the following gives me a bus error? Cheers

    void doList(char args[]){
    FILE *file;
    char c;
    List *list = NULL;

    file = fopen(args, "r");
    while(1){
    c = fgetc(file);
    if(c != EOF){
    list = insertList(c, list);
    }
    else{
    break;
    }...
    See more | Go to post

  • Hi all, sorted it, I did try making the name a pointer i.e. entry = {*name.. but i clearly didnt save before re compiling and trying all sorts of other rubbish...such a noob...oh well thanks anyways!
    See more | Go to post

    Leave a comment:


  • Error of : initialization makes pointer from integer without a cast

    Hi there, im pretty new to this forum and would be grateful of some help. I've only started programming this year and am pretty lazy with it so please bare with me if im acting like a bit of a noob...

    right basically im trying to define a struct that will hold names for a phonebook i.e. with a string and a number

    i have #included<stdli b.h> and everything else I need, and the 2 parts im struggling with are as follows...
    See more | Go to post
No activity results to display
Show More
Working...