Very cool, thanks so much.
Type: Posts; User: Pztar
Very cool, thanks so much.
Yes.
So will I have to put int tpR1 = 0; outside of the loop in main?
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...
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
Function Call
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....
Yes, it is a fixed number of columns. I'll try that out, thanks.
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...
Oops! I was trying out different things and forgot to change it back. Thanks
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...
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...
But that is the format..
Example 45 40 40
Second 62 61 63
Is that not correct?
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...
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...
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
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?
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...
Hello,
What is the best, and easiest way to extract information from Files?
For example:
I open afile.txt
afile.txt contains:
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 :)
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?
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...
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. :(...
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...
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.
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);