Feeds:
Posts
Comments

How can a user input space in scanf();?

This is how we use scanf() if the user will enter just a word:

scanf(“%s”,  &var1);

But what if the user enters an input with space, lets say a name “This S. Me”, this will only show the first word “This”, so how can we let the program read spaces?

Its actually simple, all you have to do is add this code “[0-9a-zA-Z. ]” so it will look just like this:

scanf(“%20[0-9a-zA-Z. ]s”,  &name);

where:

20 is the array size.

[0-9a-zA-Z. ]  this will let the program accept characters that range from, numbers 0-9, small letters of the alphabet, big letters of the alphabet , the character period “.” and lastly the space ” “.

s is the data type, since we are entering a string we used %s.

&name is the variable used to store the data from the user.

There you have it, now you can enter space in C.

Here is a short sample program to make things more clear.

This program is made from Microsoft Visual Visual Studio C++ 6.0

#include<stdio.h>
main()
{
char name[20];

printf(“Enter your name: “);
scanf(“%20[0-9a-zA-Z. ]s”, &name);

printf(“Your Name is: %s\n”, name);
}

In our subject Comp02, we made a site in blogspot.com, now that we are finished with our blogspot, our instructor told us to create a new site in wordpress. I was like “no way, how about our daily visitors? are we going to promote our new site again?” then it hit me, what if I can redirect my old site “http://bluesoul37.blogspot.com” to “https://callingangel.wordpress.com”

The simplest way to do this is to use the <meta tag>. To do this:

1.> Go to your old site, then go to settings, click layout, then click edit html

2.>In your <head> tag, insert this code:
<meta content=’5;url=new_site_name’ http-equiv=’refresh’ />

content has 2 parts separeted by semicolon (;), 1st is the number, 5 represents the amount of time in seconds before the viewer of your old site will be redirected to the new site. The second part is the url of your new site.

3.>Lastly you have to save your settings and you are done.

There are more ways of redirecting site but I haven’t mastered them yet so I’ll stop here.

There you go, you don’t have to promote your site all over again, your old fans or viewers will be redirected automatically to the new site.

If you have question just leave your questions in the comment box.

watch this, so sad

watch this :((

click here

First Post

Hello this is my first post here in wordpress, I’ll start adding more post in the near future.