this program counts lines and prints out the longest line from input.
#include <stdio.h>
#define MAXLINE 1000
int getline(char line[], int maxline);
void copy(char to[], char from[]);
Type: Posts; User: i_can_do_this
this program counts lines and prints out the longest line from input.
#include <stdio.h>
#define MAXLINE 1000
int getline(char line[], int maxline);
void copy(char to[], char from[]);
ok heres exactly what im trying to do. adding 2 to a number coming from input. i want this thing to loop so it will always add 2 to the input number and i wanna know how to stop the -36 from always...
i know if i dont use eof as a condition then it works and it doesnt count the '\n'. but how can i make the thing loop and not just terminate only after 1 input.
while i was bored and randomly typing code in and compiling it for no reason, this caught my attention:
#include <stdio.h>
int main()
{
int c;
while((c = getchar()) != EOF)
sorry but i realized that simply turning all the variables to floats wasnt enough, i need it to turn the function return type and parameters to floats too.... and ssharish nope thats not what i was...
no i meant i tried turning everything into float, the printf % things and the variables like c, i, and d.
im trying to write a temp conv. program from fahr to cel. by using a function , it works but im trying to make it print a number after the decimal and it gets all messed up...
#include <stdio.h>...
#include <stdio.h>
int main(void)
{
int c, d;
while((c = getchar() - '0') != EOF) {
if(c == 2)
printf("fool\n"); /* once again, my pointless messages */
...
no i meant that only c == '1' works, not c == 1 or c == RESPONSE1.
i even tried it out with a new program:
#include <stdio.h>
int main(void)
{
int c;
ok im new so if this question is wayy to easy to answer, forgive me but i have no idea....
the book im learning from says that symbolic constants are exact same values the thing they representing...
o my bad.... i guess it was the tabs problem but it was weird cause the compiler said there was an error in the "backspace if "statement .
i'm trying to do this one exercise in a book where it asks you to replace user input of blanks tabs and backspaces with the words "blanks" "tabs" and "backspaces. but somehow this printf wont...
ummm my c-free doesnt require you to pay... it just says that debugging and something else you cant use but thats it.
lol i thought it was C- "FREE" ....
since i've several problems with dev c++, i decided to look for a new IDE... i found this one called c-free which is very similar to dev C++. i heard lots of people say dev c++ is the best free IDE...
... ok theres this one exercise to write a program to show the value of EOF.. unfortunately i tried many different ways but all it came out in dev c++ is 3 "smiley faces"?? is that suppose to be a 0...
i dunno why u say to post the actual code that i tried??? this is EXACTLY what the book says and what i tried.
about getting another book, what do u recommend is good?
also another problem now....
#include <stdio.h>
main()
{
double nc;
yes it is exactly what i put in it, and for the "main" stuff,
the author of the book never uses int main he only puts main, and i also put in a random message printf before the for loop and it...
im new to c programming and im trying to learn it from "the c programming langauge" book and theres a little problem i dunno how to solve.
#include <stdio.h>
main()
{
double nc;