Search:

Type: Posts; User: Pztar

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    5
    Views
    993

    Very cool, thanks so much.

    Very cool, thanks so much.
  2. Replies
    5
    Views
    993

    Yes. So will I have to put int tpR1 = 0;...

    Yes.

    So will I have to put int tpR1 = 0; outside of the loop in main?
  3. Replies
    5
    Views
    993

    Value not being saved inside function

    Hello,

    I have a function inside of main.(ApplyCRule) In that function I'm trying to add values from a pointer(pR1) that's being passed from main that changes every time I loop. However the value...
  4. Thread: Type name error?

    by Pztar
    Replies
    4
    Views
    20,304

    Oh my god.. I can't believe I missed that. I...

    Oh my god.. I can't believe I missed that. I haven't used functions in a while so I completely forgot. Thanks a lot
  5. Thread: Type name error?

    by Pztar
    Replies
    4
    Views
    20,304

    Function Call

    Function Call
  6. Thread: Type name error?

    by Pztar
    Replies
    4
    Views
    20,304

    Type name error?

    I'm not sure why I'm getting this error.. I'm putting pointers in a function but in the line where I'm calling the function I have an error that says the following

    Error: Type name is not allowed....
  7. Replies
    3
    Views
    1,727

    Yes, it is a fixed number of columns. I'll try...

    Yes, it is a fixed number of columns. I'll try that out, thanks.
  8. Replies
    3
    Views
    1,727

    Data File in 2D Array

    Hello,

    I need help in assigning values in a 2D array to the 2nd set of elements. I'm opening a file that has rows and columns. I got the rows assigned to the 1st of elements, how do I assign the...
  9. Replies
    3
    Views
    2,658

    Oops! I was trying out different things and...

    Oops! I was trying out different things and forgot to change it back. Thanks
  10. Replies
    3
    Views
    2,658

    How can I avoid overwriting into an array?

    I'm reading in a file into an array, but when I print out the first element of the array it's always the last line of the file. How can I avoid doing this?

    Specifically I want to store the lines...
  11. Replies
    20
    Views
    6,899

    Oh, no sorry. I just used that as an example. The...

    Oh, no sorry. I just used that as an example. The actual file has more than 2 values in each line. What I'm suppose to do is, read in the files, store them and then apply another file that has the...
  12. Replies
    20
    Views
    6,899

    But that is the format.. Example 45 40 40...

    But that is the format..

    Example 45 40 40
    Second 62 61 63

    Is that not correct?
  13. Replies
    20
    Views
    6,899

    It's incorrect, I know. But I'm a beginner and...

    It's incorrect, I know. But I'm a beginner and I'm just trying to work it out.


    while (fgets(rString, 100, fp))
    {

    sscanf(rString, "%s %d %d %d", iD, &R1, &R2, &RB);
    printf("%s %d...
  14. Replies
    20
    Views
    6,899

    It's incorrect, I know. But I'm a beginner and...

    It's incorrect, I know. But I'm a beginner and I'm just trying to work it out.


    while (fgets(rString, 100, fp))
    {

    sscanf(rString, "%s %d %d %d", iD, &R1, &R2, &RB);
    printf("%s %d...
  15. Replies
    20
    Views
    6,899

    That's what I'm trying to do but it won't work....

    That's what I'm trying to do but it won't work. When I don't loop it, it returns 0 all the time. When I do, it returns only the values of the last line
  16. Replies
    20
    Views
    6,899

    Well I sort of got it figured out.. But fgets is...

    Well I sort of got it figured out.. But fgets is reading the whitespace and then just stopping. How can I make it skip to the next line?
  17. Replies
    20
    Views
    6,899

    I still don't know how to do it. I retrieve the...

    I still don't know how to do it. I retrieve the information with fgets() that works fine for me.

    But I can't get the information that I want with sscanf(). I'm not sure how to do it..

    I've...
  18. Replies
    20
    Views
    6,899

    Extracting Information from Files

    Hello,

    What is the best, and easiest way to extract information from Files?

    For example:

    I open afile.txt

    afile.txt contains:
  19. Replies
    23
    Views
    4,385

    Yes, I apologize. All the other codes I've tried...

    Yes, I apologize. All the other codes I've tried worked fine without the extension.

    But Thank you for all the help I REALLY appreciate it :)
  20. Replies
    23
    Views
    4,385

    Well I got it to work.. in an odd way. I had...

    Well I got it to work.. in an odd way.

    I had to specify the file extension too.. ".txt"

    However I do not want to do this, is there a way around this?
  21. Replies
    23
    Views
    4,385

    Yes, I just tried that. I realized when I debug...

    Yes, I just tried that. I realized when I debug it says
    ignment3.exe': Loaded 'C:\Users\P\Desktop\Assignment3\Debug\Assignment3.exe', Symbols loaded.

    So i thought I'd put the files in the Debug...
  22. Replies
    23
    Views
    4,385

    I really don't know what I'm doing wrong. I set...

    I really don't know what I'm doing wrong. I set my files in my same folder where the vcxproj file is. It just won't open no matter what I do.

    CommonTater: I did what you said, it didn't work. :(...
  23. Replies
    23
    Views
    4,385

    Nope, still nothing. I'm not sure how to use...

    Nope, still nothing.

    I'm not sure how to use the _getcwd() command.

    I am on a Windows machine, and the fact that I do not know is because I've only taken a Intro to C, class. Where this is one...
  24. Replies
    23
    Views
    4,385

    Okay okay, I got it the first time haha. Yes,...

    Okay okay, I got it the first time haha.

    Yes, the files are all in the same directory. I've tested a similar code that my friend made although his was "hard coded" and his works just fine.
  25. Thread: c problem

    by Pztar
    Replies
    9
    Views
    1,310

    Try doing this at the end of your loop. ...

    Try doing this at the end of your loop.



    printf("Quantas horas por dia, em media, passa o mora de pijama?\n");
    fflush(stdin);
    scanf("%d", &horasdepijama);
Results 1 to 25 of 27
Page 1 of 2 1 2