stackoverflow1453

Programming&&Games&&Life

Archive for Visual Studio 2008

How to import a setting to Visual Studio?

Download the setting file. (.vssettings extension)

For example: http://studiostyl.es/schemes/vim-darkblue

Then go Tools/Import Export Settings/Import Selected Environment Settings

and choose the file you downloaded above. Thats all…

Which font should I use for coding?

This guy compiled great fonts for coding in this site.

http://hivelogic.com/articles/top-10-programming-fonts/

I use “DEJA VU SANS MONO” in my Visual Studio environment.

You can download this font from here:

http://dejavu-fonts.org/wiki/index.php?title=Main_Page

also “proggy” seems nice too.

You can download proggy from here:

http://www.proggyfonts.net/download/

NOTE: Be sure you download true type fonts (ttf). Other fonts do not work in Visual Studio. And don’t forget to restart visual studio after changing editor font. Otherwise it wont work.

6 Visual Studio Shortcuts You Must Know

1-

SHIFT + Del: This one will cut the entire row from the document and past it to the clipboard. No need to select the row, just put the marker there and click SHIFT + Del and it is gone.

2-

F12: I think you all know this but still F12 is the shortcut for the “Go to definition” command which will take you to the definition of the object your marker is currently on.

3-

F9: Another one i think you all know, clicking on F9 will add a breakpoint to the code line your marker is currently at. Clicking F9 again will remove this breakpoint from that line.

4-

CTRL+M+M : Expanding / Collapsing code blocks, e.g. regions/methods.

5-

Ctrl+Tab is a very handy.
Ctrl+Tab flips forward and backwards, between the last two accessed files.

6-

Alt+UpArrow: Go to the beginning of the function
Alt+DownArrow: Go to the end of the function

Visual Studio experience

I installed Visual Studio to try it again.

I tried to compile this survey data analysis program in VS 2008.
https://stackoverflow1453.wordpress.com/2013/04/28/randomize-the-survey-data-analysis-program-you-made-before/

It spits these warnings:

1>c:\users\turan\documents\visual studio
2008\projects\project1\search\search\dsa.c(30) : warning C4024:
‘fillResponseArray’ : different types for formal and actual parameter
1 1>c:\users\turan\documents\visual studio
2008\projects\project1\search\search\dsa.c(32) : error C2065:
‘response’ : undeclared identifier 1>c:\users\turan\documents\visual
studio 2008\projects\project1\search\search\dsa.c(32) : warning C4047:
‘function’ : ‘int *’ differs in levels of indirection from ‘int’
1>c:\users\turan\documents\visual studio
2008\projects\project1\search\search\dsa.c(32) : warning C4024: ‘mean’
: different types for formal and actual parameter 1
1>c:\users\turan\documents\visual studio
2008\projects\project1\search\search\dsa.c(33) : error C2065:
‘response’ : undeclared identifier 1>c:\users\turan\documents\visual
studio 2008\projects\project1\search\search\dsa.c(33) : warning C4047:
‘function’ : ‘int *’ differs in levels of indirection from ‘int’
1>c:\users\turan\documents\visual studio
2008\projects\project1\search\search\dsa.c(33) : warning C4024:
‘median’ : different types for formal and actual parameter 1
1>c:\users\turan\documents\visual studio
2008\projects\project1\search\search\dsa.c(34) : error C2065:
‘response’ : undeclared identifier 1>c:\users\turan\documents\visual
studio 2008\projects\project1\search\search\dsa.c(34) : warning C4047:
‘function’ : ‘int *’ differs in levels of indirection from ‘int’
1>c:\users\turan\documents\visual studio
2008\projects\project1\search\search\dsa.c(34) : warning C4024: ‘mode’
: different types for formal and actual parameter 1 1>Build log was
saved at “file://c:\Users\Turan\Documents\Visual Studio
2008\Projects\Project1\Search\Search\Debug\BuildLog.htm” 1>Search – 5
error(s), 9 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

🙂 😀 😦

This Code worked in DevC++ flawlessly. I searched google and then the problem was Visual Studio’s compiler was old.

****************************************************************************************************************************************************************************
What is the cause?:

You can’t declare a variable after any non-declarations in old C:

int main(void)
{
    srand(time(NULL));
    int response[SIZE]={0};  // This can't go here!
    ...

in Visual Studio. You need to declare your variables at the top of the scope:

int main(void)
{
    int response[SIZE]={0};
    srand(time(NULL));
    ....

It’s a feature of modern C that Visual Studio’s C compiler doesn’t have.

Question: How can I upgrade Visual Studio’s compiler?
Answer: You can’t. You have to wait for Microsoft to become C99 compliant.

Nice…

**************************************************************************************************************************************************************************

Below is a blog post begging Microsoft for C99 support.

http://blog.reverberate.org/2012/03/microsoft-please-support-at-least-tiny.html