if(isspace(cin.get(c))){
count++;
}
if(count == 2){
c = toupper(cin.get(c));
count = 0;
}
Type: Posts; User: CeeCee
if(isspace(cin.get(c))){
count++;
}
if(count == 2){
c = toupper(cin.get(c));
count = 0;
}
>>No strings or arrays used in this program, only char.
Then it can't be done. You need to put the line in an array and go through it reading spaces until you read two and then the next character...
So that would be a no? Because I was using the same technique that another program I found while surfing used and it worked great. I don't understand why
struct _FuncInfo
{ char name[20],
...
Everyone says that you can use fread to input a structure, right? For some reason this code doesn't work and I can't figure out what I'm doing wrong.
#include <stdio.h>
#include <string.h>
...
I understand now, thank you. Here is the fixed function, it works just fine now.
#ifdef DEBUG
void encrypt(char *message)
{
char *p = message;
assert(p != NULL);
while(*p...
How can I get the first function to work?
Here's a funny problem. I want to take a string and encrypt it, which works fine when I treat the string that is passed to my function as an array, but when I treat it as a pointer it encrypts the...
What are they really good for? In every case of pointers that I've seen, just one pointer would work fine yet the programmer chose a pointer to a pointer. Why would I want to use that instead of just...
Sorensen:
Thank you, but isn't your loop the same as mine in functionality except for which pointer it frees? If there's a favorable difference I'll start doing it that way.
Imperito:
I wasn't...
Good idea, so I can make a 50000 node list and use a recursive function to free it all. I'm sure recursion is okay for small lists, but my question has nothing to do with the actual method of freeing...
This is a very specific and detailed question, but at the end of this free method will my pAhead pointer need to be deleted since it should point to NULL?
pList = pHead;
NODE * pAhead =...
That worked great, but when I transferred the list to my program I get an access violation error when I run it. I went through the program step by step with the debugger and everything seems fine.
...
After you delete a pointer it's gone, you can't use it anymore. However, if you intend to use it again then you can set it to NULL when you've finished with it's original value so that you don't...
I don't see what the problem is, when I try to print out the list it just prints the last string entered equal to how many nodes there are. I know it's something simple, but I just can't see it.
...
I tried using allegro_s.lib and that didn't work, but putting the DLL in my windows directory did the trick. Now I need to learn how to use allegro :)
Do you know of any good basic tutorials on...
I downloaded and installed everything, but now I get an error message when I try to link my program. Otherwise the program compiles fine.
The first is: "A required .DLL file, ALLEG.DLL, was not...
There doesn't seem to be a CRT directory, and any CRT files are encrypted
MSVC++ 6
>if(isdigit(department))
Looks good to me
>if(department<1 || department>9)
That should be if(department<'0' || department>'9')
but another way would be if(!isdigit(department))
or just use...
I'm not sure if this will help, but I looked on google and found this.
Post some more of your code and what the desired output is as well as the actual output. What you have now isn't enough to know what's wrong.
Is there a way that I can look at the source code for the standard C++ classes? When I look in the header files like iostream.h all I see are declarations, but no implementation.
At current I'm storing the data in three different classes, one for employess, one for customers, and one for inventory. The two classes for employees and customers are derived from an abstract...
So I should create a generic binary tree class and three linked lists, one for each data category. Then I instance the binary tree class and pass it a pointer to each node of one of the linked lists....
FOR is a loop, it just looks different than a while, these two loops are equivalent.
// a for loop
for(int i=0; i<10; i++){
cout << i << endl;
}
// a while loop
int i = 0;