Search:

Type: Posts; User: bhdavis1978

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    28,092

    By the way, strtok allows you to tokenize strings...

    By the way, strtok allows you to tokenize strings in C, doesn't it?
  2. Replies
    8
    Views
    28,092

    I don't need to be able to identify what they...

    I don't need to be able to identify what they entered as an specific identifier. I know that the number will always represent the variable position, and that the character that immediately follows...
  3. Replies
    8
    Views
    28,092

    Using scanf with enum types

    Hi all,

    I've got my own enum type set up as follows



    typedef enum aa
    {
    a= 0, ala= 0, alanine= 0,
    r= 1, arg= 1, arginine= 1,
  4. Replies
    3
    Views
    9,597

    nvm, figured it out with strtok. I think I just...

    nvm, figured it out with strtok. I think I just needed a break from the computer and some more sugar, caffeine and nicotine.

    In case anyone is searching and finds this thread, this is how I did...
  5. Replies
    3
    Views
    9,597

    Okay, my brain is clearly fried. Thanks...

    Okay, my brain is clearly fried.

    Thanks BillyTKid.

    What if the string is more complicated, something like

    275g -> 34g 201q 202q 221s 266g 328m 334t

    If there is any...
  6. Replies
    3
    Views
    9,597

    Parsing a string

    Does anybody have any snippet of code they'd be willing to share to help me parse a number and a letter from a short string that looks like this 275a into 275 and a? There isn't an explicit limit on...
  7. Replies
    16
    Views
    11,136

    Awesome tool kermit, thanks.

    Awesome tool kermit, thanks.
  8. Replies
    16
    Views
    11,136

    The glibc error was due to a really severe buffer...

    The glibc error was due to a really severe buffer overrun. Now I've solved the problem in the interim by making my buffers many times larger than I expect will be needed (40960 bytes), but I think I...
  9. Replies
    16
    Views
    11,136

    So I solved that problem by doing two things-...

    So I solved that problem by doing two things- linking against c99 library (which got rid of the GLIBC_2.7 not found error) and by swapping out the sscanf statement for an atof. I considered...
  10. Replies
    16
    Views
    11,136

    It seems like the problem actually might be...

    It seems like the problem actually might be replaced to pch, rather than to sscanf. I modified the following line


    pch = strtok(buf, ",");
    printf("after strtok\n");
    printf("pch contains...
  11. Replies
    16
    Views
    11,136

    I completely agree with you regarding debugging. ...

    I completely agree with you regarding debugging. Normally when I write new routines I debug them exactly that way- one call at a time, directly from main to make sure they're working, for exactly...
  12. Replies
    16
    Views
    11,136

    Yes, it did crash at exactly the same place. I...

    Yes, it did crash at exactly the same place. I will definitely put some && k < n tests in there, that's a very good suggestion.

    I'm confused why a cause and effect situation would be implied if...
  13. Replies
    16
    Views
    11,136

    Here is the code for the whole routine float...

    Here is the code for the whole routine


    float *f_retrieve_vector(char filename[], int n)
    // in most cases n= 1000;
    {
    FILE* fp;

    int k= 0;
    float *f;
  14. Replies
    16
    Views
    11,136

    I'm unfamiliar with gdb, but I'm trying it...

    I'm unfamiliar with gdb, but I'm trying it anyway. Usually I just use the built in debugger in xcode, which is really helpful, but I'm unfamiliar with gdb.
  15. Replies
    16
    Views
    11,136

    sscanf segmentation fault

    Hi all,

    I'm having a segmentation fault that I don't understand. The program compiles and runs just fine on any number of different Macs I've tried it on (OSX 10.5, and 10.6), but when I tried...
  16. Hi Jorl17, Thanks for the reply. As far as I...

    Hi Jorl17,

    Thanks for the reply. As far as I know (which is admittedly limited), return values are limited to between -255 to 255, and the value being returned will be a float- and I won't have...
  17. Calling a python script and obtaining a return value

    Hey all,

    I would like to be able to call a python script from within a C program, and then have that python program return a single value back to the C program. One (extremely kludgy) way to do...
  18. Comparing contents of dynamically allocated vectors

    nevermind, nothing to see here, I'm a moron.
  19. Replies
    16
    Views
    4,529

    I've just taken a cursory glance through this,...

    I've just taken a cursory glance through this, but there is a pretty fundamental error in your questions

    area = ((PI)*(d_gasket^2)-(d_hole^2))/4;

    In C, the ^ operator does not mean "raise to...
  20. Replies
    2
    Views
    1,087

    Segmentation fault

    Hi all,

    I've got a segmentation fault occurring that I don't understand, and I'd appreciate your help. First, the relevant structure



    typedef struct node
    {
    //sequence for this node...
  21. Replies
    2
    Views
    2,729

    Thanks a lot, that helped out immensely. ...

    Thanks a lot, that helped out immensely.

    Cheers,
    Brad
  22. Replies
    2
    Views
    2,729

    Parsing strings from an input file

    Hi all,

    I'm trying to parse out a bunch of information from a parameter input file, which I will paste below:

    1000,250000,5,0,1, /Users/davis/Desktop/TEST,/Users/davis/Documents/covarion...
  23. Replies
    3
    Views
    1,002

    Yeah, I am using Xcode/gcc. I'm sure I had the...

    Yeah, I am using Xcode/gcc. I'm sure I had the version I was supposed to have- it's been working for months, and then this happened. I went to the command line and tried to compile a simple program...
  24. Replies
    3
    Views
    1,002

    Strange execution error

    Hi all,

    I'm having a very strange execution error, even on extremely simple Hello, World programs.
    e.g.



    #include <stdio.h>

    int main (int argc, const char * argv[]) {
  25. Replies
    9
    Views
    1,717

    That specific structure won't work in this case,...

    That specific structure won't work in this case, but that's an interesting suggestion. I've come up with another idea too, which might work. It'd be slower than my matrix of matricies approach, but...
Results 1 to 25 of 40
Page 1 of 2 1 2