the code will print some garbage value as the variable 'a' is not initialized, ie. it does not contain any value at the time it is being used by printf().
void main()
{
int a;
...
Type: Posts; User: Tanu
the code will print some garbage value as the variable 'a' is not initialized, ie. it does not contain any value at the time it is being used by printf().
void main()
{
int a;
...
try to rethink the logic of flip()
you are printing only once when k reaches the length of the string passed in your case 3.
try printing in the else block after calling flip() & before calling...
Well...
The OP may not have checked this thread. But it was quite informative for me, still a n00b.
Thanks for this lively discussion.
so, did you achieve your goal or do you want the program to do anything more???
you need to declare your variables i,j,k before you use them
& you also need to replace semicolons(;) with commas(,) in fscanf & fprintf.
Here are a few suggestions...
try using fgets instead of getc.
use a counter to count and print the number of lines in the text.
Learn how to indent your code.
try to read more before...
As you have said you are kinda sure about 2'nd problem i'd try to help you with other two...
first of all you can't define the function "selection sort" inside main function & you have not even...
You are not checking all the possible conditions...
a<b<c
a<c<b
b<a<c
b<c<a
c<a<b
c<b<a
& i'd suggest using nested ifs...
Hey everyone.
I'm trying to create & use a static library but kind of stuck at something I can't quite grasp...
I have created library file containing just 2 functions dealing with temperature...
i suppose yuo are referring to Salem's statement...
But I don't understand how a data type is encoded or how C manages memory access. As I said earlier, its only my first week of doing C.
...
from what i understand
the second statement should not work as &count would represent the address of the variable count, & the ASCII character associated with it shouldn't be the same as the one...
the code i posted is the actual code i wrote in class...
the objective of the class was to practice the use of "While loop" & to print the English alphabet.
i noticed that i could do it by using...
I'm not looking to learn allot of programming. I don't want deep & meaningful knowledge of C. I'm a student of Biology & in future I'm going to be studying Genetics or Medicine. But I have to clear...
let me give the details...
I'm using the "Turbo C++" compiler.
& i cam upon this when we were making a program that prints the alphabets A-Z & a-z...
here's the code :
#include<stdio.h>...
it doesn't produce memory address violation or any other error...
I'm new to programming & I stumbled upon this & i couldn't find any explanations in my book or from my teacher so i posted here. ...
can someone explain me the difference between the 2 statements...
1. printf("%c",count);
2. printf("%s",&count);
count is an integer & both the statements do the same thing : print the...