stackoverflow1453

Programming&&Games&&Life

Archive for April, 2013

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

This is hilarious! A must read about anti-piracy issues.

http://www.ign.com/articles/2013/04/29/the-best-anti-piracy-measure-ever

 

 

NetBeans thoughts

+ Editor senses syntax errors,uninitialized variables as you type. I am not sure but people call this intellisense I think. Very nice feature.
+ Auto Indention works really well. No edit needed while coding (one space here one backspace there sort of things)
+ When I click on a variable, editor highlights all the variables of the same name.
+ There is a navigator which shows what the variables, functions I made throughout the program. When I click on it it takes cursor to function directly.
+Alt+Mouse Wheel Down or Up zooms in or zooms out the text. This is a very good thing.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=173732
Internal Console does not work with code that has scanf in it. So, You have to change to external console. And you have to do this for every project. You can not make this default!! This is irritating. There is no workaround. I don’t understand how the creators of this program forgot to implement a default checkbox to output console choice. I searched internet but could not find a solution. Scanf does not work in internal console!

https://bugs.eclipse.org/bugs/show_bug.cgi?id=173732
This is a crazy bug that nobody could solve. Just workarounds exist.

I tried Visual Studio 2008 but I did not like it. I prefer DevC++ over it.
When I have time I will try Eclipse. At work I use it but I have no idea if it is good for C/C++. If you used it for C/C++ please let me know.
My choice seems NetBeans now.

NetBeans C/C++ IDE (Awesome so far!)

I downloaded netbeans C/C++ version (53 MB) from

https://netbeans.org/downloads/

Installation instructions are here:

https://netbeans.org/community/releases/73/cpp-setup-instructions.html#verifying

It was easy to configue according to the installation instructions.

What I liked is you do not have to compile once to see the syntax errors or other things like DevC++. This beast compiles continuously and a small red circle appears if you made a syntax error or some other uninitialized variables. This is so helpful. I will continue from this.

Chasm!!! Pretty awesome game and free! Controls are very good. I did not expect this. Also has a kickstarter campaign

http://www.kickstarter.com/projects/discordgames/chasm

You can download this game from this page and play.

http://www.indiedb.com/games/chasm

İstanbul’u Dinliyorum – Zülfü Livaneli

This song played in theater Leyla’nın Evi. I Love it.