Thanks for the help! As you mentioned, it's not formal C so being able to recognize the basic format was the idea. I know some couples like to be surprised with the gender reveal which was the...
Type: Posts; User: scotdani
Thanks for the help! As you mentioned, it's not formal C so being able to recognize the basic format was the idea. I know some couples like to be surprised with the gender reveal which was the...
Hello, coding aficionados! I've dabbled a bit in C during my academics and want to have some fun with writing a short function that sums up pregnancy. I'd then like to take that code snippet and...
I'm trying to use a scanf to get an input from the user of 2.1 or 2.2 to activate a function call and haven't found much to solve this.
I'm using a float type and when I watch it stores as...
I've only had a small introduction to structs but I'll try this out.
Changing that k variable to sizeof fixed the issue I was having before. So many ins and outs I need to remember!
Thanks for the help. This is working great, and yes your assumption is correct. Now to brush up on passing arrays to functions.
As I mentioned above, the numbers get math done to them.
A...
[QUOTE=john.c;1277991]Try something like this:
QUOTE]
This is great! Would getting these values into an array be as simple as changing the declarations and putting this system into a for loop?
The data given is as follows:
PART,3.00,+1,0.010,F
PART,0.975,-1,0.025,V
PART,2.00,-1,0.050,V
GAP,0.000,0.080
The starting word and last letter are identifiers, and the numbers get math done...
[QUOTE=john.c;1277984]Just use sscanf.
QUOTE]
I forgot to mention this is reading from a .txt file. I'll post the loop.
for (N=0; fscanf(fpin, "%s ",descriptor) != EOF; N++){
...
I'm having trouble getting a string tokenizing function to scan the last value of a string and proceed to the next line. This runs in a for loop to tokenize multiple lines.
Example:...
Thank you. I will spend my time elsewhere.
I certainly agree if I had the choice in the curriculum. I'm just looking for help to get a good grade and attempt to understand it. I hold no shame in holding someones hand through the programming...
What I was thinking was how to pass pointers in main only compared to between main and a function. One of the assignment constraints is to scan for the variables in main then use a function for each...
Ok I'm starting to get it now. When using pointers in main, say if I took this function and place it in main, how different or similar would it look?
Look, I'm not interested in being belittled for my novice experience with C, and it was a timing issue that I did not immediately see your edited code.
That being said, thank you for demonstrating...
Would I modify the prototype and definition to be *a, *b,.. and the declaration and return be &a, &b,...? I'm thinking my printf's need the same &a treatment?
I made some progress in writing out the beginning of this program. I think this is where I need to start working on using pointer language. If I understand you're first response, I need a second...
Thanks for the resources. I will keep these in mind. Programming is definitely something that is still quite foreign to me but I definitely have gained appreciation for those that excel at it.
...
I do not have much going on yet since I have four weeks to finish it up. In general I don't know how to use pointers but even the prof said the purpose is to get us using these more regularly since...
Hopefully this works:
1. First,read this document in its entirety. After reading this handout, you may optionallycreate a design sheet for the problem. Your design sheet should help youdetermine...
I think it's because the doc used Equation Editor and didn't translate well when I copied it. I'll repost shortly.
Below is the instructions for the program to be written. The steps that specify call by reference with pointers are 4 and 7; it copied in funny. I'm suspecting there is going to be some sort of for...
I'm kicking off on another semester in C programming and one thing I have not been able to successfully wrap my head around is pointers, and then their employment in call-by-reference functions. Can...
I finally had success in getting this program to function. This stuff is not intuitive to me at all so little things were causing it to fail, such as having the array declaration stand alone from...
Ok I got a little guidance from the TA in the class so it's better. But when I run it doesn't do anything. I honestly have no clue how to make this thing work and it's really driving my anxiety up...
I loaded your example here into my compiler, CodeBlocks 16.01, and it doesn't like the last for loop you wrote, line 181. Reading through it line by line I just got confused because I don't have a...