I thought then you were just trying to make me think.
Type: Posts; User: richdb
I thought then you were just trying to make me think.
That's all true, but how is text[] ever going to equal the remainder? Is there a condition that has to be met? I don't know how the return statement is read.
I pretty much understand that whole thing, but how does that return statement work: The remainder of sum / 11 is equal to text[] - '0' ? If we used 0132261197 for the ISBN, Text[] would equal 9 at...
Hi,
I am trying to figure out this program. It accepts an ISBN (International Standard Book Number) from the user, and then decides whether it was entered correctly or not based on the formula...
so this is a full version they send? I don't understand why they would do that.
and how do we get this....?
Yeah, but other compilers do it automatically when you type certain keywords.
That's alot better.
#include <stdio.h>
main()
{
int a=2,
It is set to 2. But playing with it doesn't seem to help. The code doesn't indent in the places it should, and braces don't wrap correctly either. When I write a loop, it comes out looking like this:...
I already have that selected, but it doesn't change anything.
I know this has been covered before, but I can't get dev-c++ to do indentation. I have tried the obvious things like: Tools, editor options. But whatever I try, I can't get it to do decent...
Thanks
But only once, when the for loop ends (hits '\0')
for ( i = 0; source[i] != '\0'; ++i )
{
if ( src == source[i] )
{
return target[i];
}
}
return src; /*...
Dave,
I follow you completely, but let me make sure of some things. src is the user input? And why return src when the for loop ends?
I want to use static to force the pointer, (only the for loop instance of it) to retain its value instead of being reinitialized when the loop starts over.
I know about gets but I'm trying to...
Its a problem from a book, to do a simple encryption on a string. It basically looks at the character from the user, checks the 'source' array for that character, and replaces the user's character...
Hi,
Why can't I get static to work here? Where static is highlighted in blue.
#include <stdio.h>
main()
{
char source[] = "qazwsxedcrfvtgbyhnujmikolp";
char * src_ptr;
Hi,
I am trying to write this program that does a very simple encryption on a string input by the user. It basically looks at the character from the user, checks the 'source' array for that...
So I would have to make the pointers large enough to store the words?
So my screwy output is not because of missing '\0's?
I'm trying to get each word on its own line.
I'm really just trying to see if you can manually enter the data into an array of pointers and...
I was really just trying this to find out if when you enter data into an array of pointers if the \0 (NULL) would get added automatically. I'm thinking it doesn't.
Im just starting to learn...
I'm just initializing the data into the pointers for now, so why wouldn't their contents print correctly?
Hi,
I'm trying to enter the days of the week into this array of char pointers, but the output is strange.
Please enter the days of the week:
Day 1: Monday
Day 2: tuesday
Day 3:...
ahh yes,
I have experienced the problem with gets() already. The program crashes with a windows error if the input is to large.
I see. But there is no way you can enter the sentence at once and be able to access each word as an individual element?