Skip to content

Instantly share code, notes, and snippets.

@Zoha131
Created September 7, 2016 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zoha131/d119fbefb079b22be540203a5f439536 to your computer and use it in GitHub Desktop.
Save Zoha131/d119fbefb079b22be540203a5f439536 to your computer and use it in GitHub Desktop.
From the lecture video and reference.cs50.net I have learnt to use get_string(void) this method but It don't work in cs50 IDE. Instead of get_string(void), GetString() method is working in my IDE.
#include <cs50.h>
#include <stdio.h>
int main(void){
printf("type char:");
printf("This is char %c\n\n", GetChar());
printf("type double:");
printf("This is double %f\n\n", GetDouble());
printf("type float:");
printf("This is float %1.5f\n\n", GetFloat());
printf("type int:");
printf("This is int %i\n\n", GetInt());
printf("type long long:");
printf("This is long long %lld\n\n", GetLongLong());
printf("type string:");
printf("This is string %s\n\n", GetString());
}
#include <cs50.h>
#include <stdio.h>
int main(void){
printf("type char:");
printf("This is char %c\n\n", get_char(void));
printf("type double:");
printf("This is double %f\n\n", get_double(void));
printf("type float:");
printf("This is float %1.5f\n\n", get_float(void));
printf("type int:");
printf("This is int %i\n\n", get_int(void));
printf("type long long:");
printf("This is long long %lld\n\n", get_long_long(void));
printf("type string:");
printf("This is string %s\n\n", get_string(void));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment