User Profile

Collapse

Profile Sidebar

Collapse
jmprince01
jmprince01
Last Activity: Oct 16 '06, 12:55 AM
Joined: Sep 8 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • jmprince01
    replied to debugging help please in C
    in C
    still working on this. i changed the <list.h> to "list.h" which gave me a bunch new errors. they're all "undefined reference to 'some function'", but all my functions are defined in list.h. (yes, list.h is in the correct director with the other two files) so how do i fix the "undefined reference" problem? i am honestly not getting this.
    Here are my new errors:

    Code:
    main203{jprince}6:
    ...
    See more | Go to post

    Leave a comment:


  • jmprince01
    replied to debugging help please in C
    in C
    here are my compiler errors

    Code:
    main203{jprince}9: gcc driver.c list.c list.h -o driver
    driver.c:4:19: list.h: No such file or directory
    driver.c: In function `main':
    driver.c:17: error: `INITSZ' undeclared (first use in this function)
    driver.c:17: error: (Each undeclared identifier is reported only once
    driver.c:17: error: for each function it appears in.)
    driver.c:17: warning: assignment
    ...
    See more | Go to post

    Leave a comment:


  • jmprince01
    started a topic debugging help please in C
    in C

    debugging help please in C

    I have three files list.c list.h driver.c. they dont compile properly (they are to be compiled together). i can't find my assignment specs right now, i'll try to post them soon. but maybe someone can make sense of this w/o my instructions?

    Code:
     list.c
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include "list.h"
    
    #define LISTSZ(a) (((a)-1)*sizeof(char*)+sizeof(struct
    ...
    See more | Go to post

  • jmprince01
    started a topic reading two lines from stdin using fgets
    in C

    reading two lines from stdin using fgets

    i have the following code which works just fine:

    printf("Enter a string: \n");
    fgets(ch, 1024, stdin);


    but i need it to read two lines. this quits as soon as i hit the enter key. how can i fix this up to allow two lines?
    See more | Go to post

  • jmprince01
    replied to this won't compile
    in C
    //I made some changes and made comments. note the error messages at the
    //bottom..... Thank you.

    void sreplace(char newc, char oldc, char *s){

    while(char *s != '\0'){
    *s= oldc; //setting *s to the first character in the array
    if(*s = newc){//
    oldc=newc; //change oldc to newc
    }
    s++; //increment *s every time through the loop
    }

    return;...
    See more | Go to post

    Leave a comment:


  • jmprince01
    started a topic this won't compile
    in C

    this won't compile

    ***instructions : write a function sreplace( ) with the prototype:
    void sreplace(char newc, char oldc, char *s);
    which will replace all occurances of the character oldc with the character newc in the string s. there is no return value so merely do a return***

    I *think* this code makes sense. but it wont compile. please help. thank you.


    void sreplace(char newc, char oldc, char *s){
    ...
    See more | Go to post

  • jmprince01
    replied to string match function
    in C
    you're the greatest. thank you.
    See more | Go to post

    Leave a comment:


  • jmprince01
    started a topic string match function
    in C

    string match function

    in C, write a function [char *strmatch(char *str, char *s)]
    which will find the first occurance of the string s in the string str and will return a pointer to the first match if such a match occurs. if there is no match, then strmatch() should return NULL

    Here is what i came up with. am i close?

    char *strmatch(char *str, char *s)
    while (char *str != '\0'){

    if (*str == *s){
    return...
    See more | Go to post

  • jmprince01
    replied to convert tabs to spaces
    in C
    i am posting again hopefully some one can help?

    the assignment is as follows: write a c program that will read from stdin (using getchar()) and replace tabs by the number of blanks that will achieve the same spacing. (8 spaces in a tab)


    here is my code, what i came up with:

    Code:
    #include <stdio.h>
    
    int main(void)
    {
    char ch, tab;
    int c;
    ...
    See more | Go to post
    Last edited by Banfa; Sep 11 '06, 12:56 AM. Reason: Added code tags

    Leave a comment:


  • jmprince01
    replied to convert tabs to spaces
    in C
    the assignment is as follows: write a c program that will read from stdin (using getchar()) and replace tabs by the number of blanks that will achieve the same spacing. (8 spaces in a tab)


    here is my code, what i came up with:

    #include <stdio.h>

    int main(void)
    {
    char ch, tab;
    int c;

    while((c=getcha r())!=EOF){
    tab=" "; //tab...
    See more | Go to post

    Leave a comment:


  • jmprince01
    started a topic convert tabs to spaces
    in C

    convert tabs to spaces

    my assignment is to convert tabs to spaces (8) in C. we are supposed to use getchar() and not expand(). can someone get me started? it should be REALLY simple so i can grasp it!
    Thanks
    jp
    See more | Go to post
No activity results to display
Show More
Working...