Sorry the "//" befor I++ shouldn't be there. The words[i-1] was supposed to take away the \0 from the string to make it an array.
I'm just rally confused about the whole concept of reading a string...
Type: Posts; User: mshel130
Sorry the "//" befor I++ shouldn't be there. The words[i-1] was supposed to take away the \0 from the string to make it an array.
I'm just rally confused about the whole concept of reading a string...
If. We're to initialize I=0; I still get random symbols when I run the program...I can't figure out why.
cant get it to print an external file
i have a file called months.dat
with all the months in the file...
#include<stdio.h>
#include<string.h>
#define MAX_LEN 100
No, we have not learned arrays yet.
//Program requires user to enter a number
//program should then print out the name of each digit
//I cant seem to get my program to work it keeps spelling out
//each digit as "zero"
//does anyone...
If i enter number 17.
n=17/10=1.7 which satisfies the for loop
so therefore (i=1; n>0;i++)
does the for loop execute again? or does it stop there.
because int n is declared as an integer does...
// program asks user to enter a number
//the program then prints how many digits user entered.
//code works.
//what I don't understand is how the for loop works.
//can someone explain each step...
Thank you tabstop. I fixed the error by("Don't lie to printf") backing up printf with 3 numbers and achieved the desired results.
After running my code it spits out long numbers.Im new to C so im not sure what I
am doing wrong.
#include <stdio.h>
int main(void)
{