Skip to content

Instantly share code, notes, and snippets.

@satipants
Created July 13, 2016 22:04
Show Gist options
  • Save satipants/1b5d6e77b1408cf115ad7e7f3c6c7b76 to your computer and use it in GitHub Desktop.
Save satipants/1b5d6e77b1408cf115ad7e7f3c6c7b76 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <cs50.h>
#include <ctype.h>
#include <string.h>
int main(void);
{
string name = getstring()
if (name != NULL);
{
printf("It is I, the great ABREVIATOR! If you tell me your name, I'll provide your initials!\n");
printf( "%c", toupper(name[0]));
for (int i = 0, n = strlen(name); i < n; i++)
{
if (name[i])== ' ')
printf('%c', toupper(name[i+1]) );
}
break;
}
@sqlbyme
Copy link

sqlbyme commented Jul 13, 2016

So since I'm behind in class I'm going to ask some silly questions to start:

  1. What is the purpose of this program?
  2. Do you have the cs50.h file loaded on your machine?
  3. Do you need to be able to compile and run this program?
  4. What should the output look like if everything is working correctly?

Overall you are off to a good start. There are some syntax errors which are easy to fix. Beanz will need to take a look as C is not in my wheel house, however, I think I can get you 99% of the way there. It would be helpful if you actually put this in a git repo on your computer and commit it to github on your account. I can then fork your repository and make changes and test and then issue pull requests for your to review my changes and merge them in to your code if you like them. It's how all the cool kidz work these daze.

@sqlbyme
Copy link

sqlbyme commented Jul 13, 2016

Actually, strike that last about creating the repo, we can work right from this Gist (this is new to me too).

@sqlbyme
Copy link

sqlbyme commented Jul 13, 2016

Let me try and make a change and see what happens.

@sqlbyme
Copy link

sqlbyme commented Jul 13, 2016

Take a look at the revision history here:
https://gist.github.com/sqlbyme/339ae1cb2a95c4af708bf177cf60ef25

I can help you merge these changes in to your file, or you can just type stuff. Your choice, though you may learn more typing your way through it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment