Infarction 503 Posting Virtuoso

Just noticing a few things (using WaltP's code as a reference):
1) using sizeof(buffer) will not give you the right length since buffer is a pointer, so it'll probably be the same size as an int. You don't want actualMessage to be 4 chars long (assuming an int is 4 bytes). You should use strlen(buffer) rather than sizeof(buffer) .
2) memory allocated needs to be deleted. ;)

[edit:] here's an example of what I mean in part 1:

#include <stdio.h>

void foo(char* c)
{
        printf("size: %d\n", sizeof(c));
}

int main()
{
        char array[128] = {0};
        printf("size: %d\n", sizeof(array));
        foo(array);
        return 0;
}

output:

$ ./a.out 
size: 128
size: 4

[edit 2:] Also noticed: the OPs method of allocating a dynamic array on the stack is only supported by a couple compilers and isn't very portable. Probably want to use new/delete (or malloc/free) instead, as the other replies have done.

Infarction 503 Posting Virtuoso

wtf is Hoth?

omg you didn't seriously say that... :eek:

Infarction 503 Posting Virtuoso

Congratulations to Narue! :D

Infarction 503 Posting Virtuoso

190 then 204. I will claim that the flash was a bit laggy though :P

Infarction 503 Posting Virtuoso

LOL @ Dave. That was awesome.

I was thinking something along the lines of:
- "I just can't hold it in anymore"
- "You want fries with that?"
- "Is that chick naked??"

So, what's the rest of the pic?

Infarction 503 Posting Virtuoso

never have that problem -- I learned touch typing in HS and have been touch typing every since (probably about 43 years). I think a lot of young people today learn to type on computer keyboards before they are HS age, and consequently learn typing incorrectly -- hunt-and-peck. Typing should probably be taught in grade school now -- maybe in 4th grade, so that kids will learn correctly.

They taught it back when I was in elementary (~10 years ago). We had a few typing tests where they'd put a cardboard box over the keyboard while we were typing. That was 2nd or 3rd grade.

My typing mistakes usually come up when I switch keyboards (e.g. laptop to desktop) and the force required on the keys is different. I also have some problems with getting the spaces to be where they're supposed to be, rather than a few characters early or late. And after a few hours of coding, I find it nearly impossible to type in the correctly (stupid int types).

[edit:] and I have problems with the number keys 3-5, especially with shift (#$% get horribly mixed up but used entirely too often)

Infarction 503 Posting Virtuoso

From my b-day in July...
(and I just couldn't cut the dog in half :eek:)

Infarction 503 Posting Virtuoso

What the hell was TheDude talking about? :P

Infarction 503 Posting Virtuoso

I agree with joe and Walt. And we had about as much snow here as we've had the last several years, meaning a smidgen right at the beginning of December and nothing after. Correction, we had a little more than usual. Maybe I should start worrying about global cooling... ;)

Infarction 503 Posting Virtuoso

I've heard reports of Microsoft using variants of Unix for their software development though... don't know if it's true.

Well, I'd assume they use Unix in the Services for UNIX group, but I've never heard of it otherwise.

Infarction 503 Posting Virtuoso

Just like your other posts, do your own homework. You might consider a little research on file transfer (FTP) for this. I'd also recommend you learn about TCP.

Infarction 503 Posting Virtuoso

This looks to be homework. We don't do your homework. Learn what a serial connection is and the answer is quite easy.

Infarction 503 Posting Virtuoso

you could do a rand()%36, take 0-25 as letters and 26-35 as numbers (subtract 25 from them if you want values in [1,10]). Probably use an if to determine if it's a letter or number, since the letters and numbers need to be adjusted ( theValue + 'a' for letters, numbers described above).

Infarction 503 Posting Virtuoso

Actually, I heard somewhere that larger companies usually do hold off before upgrading their systems. Smaller companies tend to move over fast partly because they don't have as many machines to upgrade, partly because they (typically) look for anything that'll give them an advantage. Larger companies often wait to make sure there aren't any vulnerabilities or bugs in a product before they make a hefty investment into it.

Infarction 503 Posting Virtuoso

flirting is better in person than on a forum

Infarction 503 Posting Virtuoso

boys want girls to fall on them

Infarction 503 Posting Virtuoso

ah, but I just got a job with Microsoft, so I'm pretty sure I'll be using it ;)

iamthwee commented: congrats (iamthwee) +6
Infarction 503 Posting Virtuoso

Forums have threads, but not all threads are part of forums ;)

Infarction 503 Posting Virtuoso

reality is a matter of perspective

Infarction 503 Posting Virtuoso

To revise my first post in this thread, I will certainly be using it when I start working in 6 months, but I'm not sure when I'll be upgrading my personal system (which barely meets some of the min reqs currently)

Infarction 503 Posting Virtuoso

Methinks this thread is entertaining

Infarction 503 Posting Virtuoso

our error-handling routines work around many bugs

Infarction 503 Posting Virtuoso

happy holidays

Infarction 503 Posting Virtuoso

you should learn to write better code then :p (couldn't resist)

Our error-handling algorithms work with many bugs

Infarction 503 Posting Virtuoso

using one of my other nicks rather than my name yielded this:

http://www.kennyliu.com/brainfart/source/20060712/weather.jpg which ironically was posted on my B-day :eek:

using this nick yieldied http://www.yourheart.org.uk/images/myocardial_infarction.jpg

Infarction 503 Posting Virtuoso

work hard, play harder

Infarction 503 Posting Virtuoso

our tech toys work with many bugs

Infarction 503 Posting Virtuoso

1) I do not watch TV
2) I love fishing, but don't like eating fish (with a couple exceptions)
3) I'm getting my Bachelor's in Comp. Sci. in only 3 years, which means that
4) I'll be out of school before I'm of legal drinking age
5) I almost always have music playing in my room

Infarction 503 Posting Virtuoso

I recommend you read the Wikipedia article and see if that clears things up. ;)

Infarction 503 Posting Virtuoso

Other people likely have different opinions on that subject ;)

Infarction 503 Posting Virtuoso

your peons work with many perks

Infarction 503 Posting Virtuoso

you think I'm a bully?

Infarction 503 Posting Virtuoso

Your peons work with no resources

Infarction 503 Posting Virtuoso

Everyone needs to realize that I should rule the world

Infarction 503 Posting Virtuoso

My peons work with any resources

Infarction 503 Posting Virtuoso

Few programmers work without any coffee

Infarction 503 Posting Virtuoso

infinite resoures is very handy in some games

Infarction 503 Posting Virtuoso

All losers cheat without great strategies

Infarction 503 Posting Virtuoso

Wont buy it myself until it's been patched and/or proven. Might end up using it at work depending on where I end up working, but won't be getting it for my personal machines any time soon.

Infarction 503 Posting Virtuoso

1) Why do you use not1, when you could just use sum <= 1.0 && sum > 0.75 for the where loop condition?

2) Do you need to record or output the random numbers you're summing?

3) What happens if the sum is over 1 before you have 10 numbers? Do you start throwing them out? Stop with a shorter list?

4) You have a paren mismatch. I'll let you fix it.

5) If you're looking for 10 numbers, why do you have i<12 ?

Infarction 503 Posting Virtuoso

Never smoked, never will. Don't have asthma, but I do find my lungs being somewhat sensitive to smoke and exhaust fumes. Probably too much exposure when I was a little kid. As long as the smoke doesn't get to me though, I don't really care what other people do.

Infarction 503 Posting Virtuoso

Primary reason to have money: to get food.

Infarction 503 Posting Virtuoso

With your purchase of my book, you will get insight on how to become wealthy; in exchange, I get your money.

Infarction 503 Posting Virtuoso

All enemies cry with perishable women.

Infarction 503 Posting Virtuoso

1) This code is in C, not C++.

2) As sunny pointed out, main() should return an int. If your professor wrote that part, well, don't copy them in the future ;)

3) For this code segment:

void EDIT(void)
{
  printf("this is stub: it means you have not coded the function yet\n");
}

You obviously haven't finished. I'm guessing it's because you've not done the input either.

4) The work for catalog() is, well, missing. Let's walk through it:

void category(void){
  int y;
  typedef struct {
    char FirstName[20];
    char LastName[20];
    char add[20];
    char city[20];
    char state[20];
    char zip[6];
    char phone[15];
  }student;
  student stu[100];
  system("CLS");
  printf("[1] NEW\n");
  printf("[2] EDIT\n");
  printf("[3] EXIT\n");
  printf("Enter a selection >> \n");
  scanf("%d",&y);
  system("CLS");

This part is mostly fine, 'cept for the system("CLS"), which is system specific. You probably don't need to worry about that for this assignment, but keep it in mind.

if(y==1)
    printf("FirstName LastName Address  City State ZipCode  PhoneNumber\n");
  qtype();
  if(y==2)
    printf("FirstName LastName Address  City State ZipCode  PhoneNumber\n");
  qtype;
  if(y==3)
    return;
  category();
}

This bit is messed up. If the user hits 1, e.g. to enter new information, you print out some text and move on. If the user hits 2, same thing happens. If the user hits 3, you return from the function. And instead of having the function call itself, it's probably better to handle the menu with a loop, like you did earlier (in menu()).

Overall, you don't even input data from the user and …

Infarction 503 Posting Virtuoso

and this link will help you get more replies ;)

Infarction 503 Posting Virtuoso

one day, a horrible dragon swept into the kingdom and captured the princess.

Infarction 503 Posting Virtuoso

still only 20, haven't found the "right one" yet... ;)

Infarction 503 Posting Virtuoso

tangibles do not soothe the heart

Infarction 503 Posting Virtuoso

1) Where is _strdate() defined? I'm not finding it...
2) Why are you using <iostream> and <stdio.h> (which should be <cstdio>)?