Homework Statement
when I am compiling my code I am getting a segmentation fault when entering in input but I don't know why?
it prints Segmentation fault: 11
Homework Equations
The Attempt at a Solution
This is my code I tried looking up what was causing it but couldn't...
Homework Statement
I am trying to flip tokens in my reverse code and I'm a little stuck
so far I have a function that checks directions but I don't know how to implement it
my code is below.
Homework Equations
The Attempt at a Solution
/reversi.c
//Samuel Gilbert...
Homework Statement
I have a simple 8X8 array with initial conditions.
how would I go about updating the an element of this array from user input?
Homework Equations
The Attempt at a Solution
for(i=0;i<MAX_SIZE;i++){
24 putchar(i+'1');
25 putchar('|');
26...
thanks will use next time
I think that's what I want though...
I am trying to program a game called reversi and I have a [8][8] array.
The user does not input numeric co-od's though ie instead of [0][0] the user input a1 which is meant to be the element of the array [0][0].
thats why I...
Homework Statement
I have some code and I use getchar to read in some input from the user say a5
I have assigned
char letter;
int number;
letter = getchar();
number = getchar();
so that putchar(letter) prints a
and putchar(number) prints 5
but when I try ...
Homework Statement
Find ∫18/((x2+9)(x-3))
Homework Equations
The Attempt at a Solution
Im a little stuck on this.
18∫1/((x2+9)(x-3))
Im not sure how to turn this into a partial fraction.. help.
Thanks
Homework Statement
Light of free space wavelength 600 nm (6000 Å) travels 1.6 10
-6
m in a medium of
index of refraction 1.5.
Find:
1. the optical path length, [This is the physical path length x refractive index.]
2. the wavelength in the medium, and
3. the phase difference...
Write a function
void tnirp(char s[]);
which takes a string s as a parameter and prints the characters of s in reverse order. Only characters up to the first '\0' or the first '\n' should be included, and a newline character '\n' should be printed at the end. Place the code for this...
Ok so If I have tnirp() at the start of the code ie
#include <stdio.h>
#include <string.h>
#define MAX_LENGTH 20
int main(int argc, char * argv[]){
tnirp()
char s[MAX_LENGTH];
but that does not fix it ,,, I have to submit this in an hour so I really need help thanks.
Homework Statement
I am trying to write up code to reverse the order of a string i.e.
input: and
output: dna
For some reason I am getting this compiling warning but I don't know what's wrong with my code...
Homework Equations
The Attempt at a Solution
#include...
the coils were placed on top of each other so the length of the coil (x) is now 2x.
then we dropped the magnet through them so at some point I guess the magnet could have been in both coils at the same time since the length of the magnet was ≈x/2.
does this make sense.
??