<script src="http://pastebin.com/embed_js.php?i=wN0E3tjz"></script>

Code:

Code:
```#include <stdio.h>#include <stdlib.h>#include <stdbool.h>int main(){typedef struct{ double x, y, z; int protons, neutrons, electrons, speed;}atom;void move(atom someatom){someatom.x+=1;}int main(){//initialize the atomatom helium;helium.x = 0;helium.y = 0;helium.z = 0;helium.protons = 2;helium.neutrons = 2;helium.electrons = 2;int time = 0;double speed = 1;//move in a straight line 100 units along the x axisint i;for (i = 0; i < 100; i+=speed){time++;move(helium);printf("time = %d: (%d,%d,%d)", time, helium.x, helium.y, helium.z);}//bounce in the boxdouble dx = 1, dy = 2, dz = 3; // these values represent the velocity vector, change these to speed up or slow down.while (true){atom.x += dx; //move the atomatom.y += dy;atom.z += dz;if (atom.x > 100 || atom.x < 0)
{atom.x -= dx; // move back to before it hitdx *= -1; // change the direction to bounce}if (atom.y > 100 || atom.y < 0) {atom.y -= dy; // move back to before it hitdy *= -1; // change the direction to bounce}if (atom.z > 100 || atom.z < 0) {atom.z = dx; // move back to before it hitdz *= -1; // change the direction to bounce}}return 0;}
```

1. My Problems:

2. line 54: atom.x += dx;
it says: syntax error before '.' token
line 58: if(atom.x>100|| atom.x<0)
it says: syntax error before 'atom'

I really appreciate the help since I am in a beginning programming class. I have NEVER coded. I'm sorry if the problems are super obvious and my code is messy, but I would love if you could make my code work for C programming. I'm using the compiler bloodshed. I'm trying to make the 'atom' bounce off the 'jar's' walls in this code. Thank you!!

2. atom is a type.

And for your move function to change the value of helium in main, you need to pass a pointer:
Code:
```void move(atom *someatom)
{
someatom->x++;
}

// the call in main:
move(&helium);```

3. Thank You, oogabooga!
I have now one simple problem with the code.
It says "syntax error at end of imput" and highlights the last bracket.

Any help is appreciated, and I am sorry if this is not how you update a post.
Please tell me the correct way.

Code:
```#include <stdio.h>#include <stdlib.h>#include <stdbool.h>int main(){typedef struct{ double x, y, z; int protons, neutrons, electrons, speed;}atom;void move(atom *someatom){someatom->x++;}int main(){//initialize the atomatom helium;helium.x = 0;helium.y = 0;helium.z = 0;helium.protons = 2;helium.neutrons = 2;helium.electrons = 2;int time = 0;double speed = 1;//move in a straight line 100 units along the x axisint i;for (i = 0; i < 100; i+=speed){time++;move(&helium);printf("time = %d: (%d,%d,%d)", time, helium.x, helium.y, helium.z);}//bounce in the boxdouble dx = 1, dy = 2, dz = 3; // these values represent the velocity vector, change these to speed up or slow down.while (true){helium.x += dx; //move the atomhelium.y += dy;helium.z += dz;if (helium.x > 100 || helium.x < 0){helium.x -= dx; // move back to before it hitdx *= -1; // change the direction to bounce}if (helium.y > 100 || helium.y < 0){helium.y -= dy; // move back to before it hitdy *= -1; // change the direction to bounce}if (helium.z > 100 || helium.z < 0){helium.z = dx; // move back to before it hitdz *= -1; // change the direction to bounce}}system("PAUSE")return 0;}

```

4. In the listing above, you need to delete lines 5 - 7.

And you're missing a semicolon at the end of line 79 (after system("PAUSE")).

5. Why do you have two int main, nested one inside the other?

When you paste code to the forum, please "paste as text". The board will line number it and syntax highlight it for you.