YEah i do, i just realized that what i was inputting effects the way it works. For example if i put in b wa wb (reverse b wa wb) which would be a pallindrome withouts spaces it gives not palindrome...
Type: Posts; User: Alphawaves
YEah i do, i just realized that what i was inputting effects the way it works. For example if i put in b wa wb (reverse b wa wb) which would be a pallindrome withouts spaces it gives not palindrome...
Still not working, ive been looking at it and i think it might be something to do with the fact that the strings are 81 characters long and the method im using to reverse them. so if i inputted lol...
Yeah i was just being desperate. My program prints out both the strings before if tests them to see if they are pallindromes. So yes everything is in order, theres just something wrong with my loop...
yeah that makes sense, now im having trouble with the coding....
#include <stdio.h>
#include <stdlib.h>
int main()
{
char str1[81];
char str2[81];
I didnt know you could specify a specific character in a string like an array, though i guess i should have... cheers to paying attention in class.
I actually used a loop very similar to this for...
Allright well i have another question now relating to strings, ill post it here because i dont feel like cluttering up the forums with small questions.
If i have a string, char str1[81]; that i...
I think i tried the second statement there, but when i compiled the compiler just crashed. Ill take a look.
edit: yes i could do the above statement but then i wouldnt be using pointers x and y...
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a, b, c;
int* x;
int* y;
int* z;
int* p;
Haha you are a smart one! I didnt really think about setting up two conditions in a for loop.
Thanks for explaining the sting/pointer question.
I have another problem ive been working on involving arrays.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int aryinput [10];
int i;
Yeah i fixed the %s issue, i just forgot to change it here. I figured it had something to do with having the wrong type, i just couldnt find it in my book, thanks.
Can someone explain how a...
#include <stdio.h>
#include <stdlib.h>
typedef struct
{
int x;
int y ;
}POINT;
int main()
{
POINT ent;
Gotcha, after looking at closer, divines code doesnt compile. Looking back at it though i dont see a need to structure it like that, because the way noir has it structured makes alot more sense. The...
That was an awesome explaination noir, thanks.
What about my integer classification question, can anyone answer that?
Allright im working on a new program. I basically need to write something that will read a text file and count the number of alphabetic characters, digits, punctuation characters, and whitespace...
Allright, well i let it be then. Thanks again.
That seems to have got it to work, dunno how though cuz counter was messed up as well.
The average will give me something like 22.00000000 because its a float, is there any way to omit those...
I did some playing around, and if you just press ctrl z by itself after youve entered everything it works as intended.
I also put sum and counter in my printf for the results, entering 13 43 57...
Allright those last two posts helped alot.
Btw when you talked about eof earlier you didnt mention ctrl z for windows ctrl d for linux you just said ctrl d or z, and you didnt mention some...
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x;
int min = 1000000000;
int max = -1000000000;
float sum;
float avg;
So if i put scanf in the parameters of the while loop i dont need to execute it in the while loop?
What is "break;"?
Maybe im not understanding what you guys are trying to tell me because im...
noir u posted this code
while ( 1 )
{
if ( scanf("%d", &x) != 1 )
{
if ( x > max)
max = x;
if (x < min)
Yeah i just edited my post cuz i realied what you where saying about do while opposed to a while loop.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x;
int min = 1000000000;
int max = -1000000000;
float sum;
float avg;
Unfortunately part of the assignment is using eof to stop the input process.