• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

CronoShot

Member
So I have an assignment in C that converts decimal to binary, and vice versa, using a menu system.

Code:
#include <stdio.h>
#include <stdlib.h>

void find_binary (int num, char str[]);
int find_int (char str[100]);

int main()
{
    int i = 0, num, choice, decimal;
    char str[100] = {'\0'};
    
    do
    {
        printf("\nAvailable choices:\n 1. Display a decimal integer in binary format\n 2. Convert from binary format to a decimal integer\n 3. Quit\nEnter the number of your choice: ");
        scanf("%d", &choice);
        
        switch(choice)
        {
            case 1:
                
                printf("\nEnter an integer: ");
                scanf("%d", &num);
                
                printf("\nThe decimal number %d has the binary format ", num);
                find_binary(num, str);
                
                break;
                
            case 2:
   
                printf("\nEnter a binary number (as 0’s and 1’s): ");
                scanf("&c", &str);
                
                printf("\nThe binary number %s has the decimal value ", str);
                printf("%d", find_int(str));
                
                break;
                
        }
        
    }while(choice == 1 || choice == 2);
    
    return 0;
}

    
    int find_int(char str[100])
    {
        int decimal = 0, i = 0, remainder, j, k;
        
        j = atoi(str);
        
        while (j != 0)
        {
            remainder = j % 10;
            decimal = decimal + remainder * k;
            k = k * 2;
            j = j / 10;
        }return decimal;
        
    }


    void find_binary (int num, char str[100])
    {
        int i = 0, length = 0;
        
            while(num > 0)
            {
                str[i] = num % 2;
                num = num / 2;
                i++;
                length++;
            }
                
                for(i = length - 1; i >= 0; i--)
                    printf("%d", str[i]);
    }

Converting decimals to binary works perfectly fine, but whenever I try to hit option 2 to input a binary number to convert, it just skips over it and just gives back 0. It never even lets me input anything, and I don't get why.
 

tokkun

Member
Converting decimals to binary works perfectly fine, but whenever I try to hit option 2 to input a binary number to convert, it just skips over it and just gives back 0. It never even lets me input anything, and I don't get why.

It is reading the carriage return.

You enter choice 2 by hitting '2<Enter>' on your keyboard. The scanf with %d reads the '2', leaving the '<Enter>' in the input buffer. The scanf with %c matches with the carriage return.

Use this instead:

Code:
scanf("%*[\n]%c", &str)

It will match only non-carriage return characters.
 
It is reading the carriage return.

You enter choice 2 by hitting '2<Enter>' on your keyboard. The scanf with %d reads the '2', leaving the '<Enter>' in the input buffer. The scanf with %c matches with the carriage return.

Use this instead:

Code:
scanf("%*[\n]%c", &str)

It will match only non-carriage return characters.

Indeed. Alternatively, you could put a "getchar()" after each scanf, but that's admittedly a bit messy.

Personally, I prefer to use fgets when I'm reading in a string in C. It only reads a single line, and should ignore the newline character (and can also be used for reading from a file, which is nice), so you don't run into that issue.
 
Can anyone give a few tips on reading assembly and then translating it into C?

One example I found:
The C code:
Code:
void swap(int *xp, int *yp) 
{ 
 int t0 = *xp; 
 int t1 = *yp; 
 *xp = t1; 
 *yp = t0; 
}
Assembly
Code:
swap:
 1. pushl %ebp 
2. movl %esp,%ebp 
3. pushl %ebx 
4. movl 12(%ebp),%ecx 
5. movl 8(%ebp),%edx 
6. movl (%ecx),%eax 
7. movl (%edx),%ebx 
8. movl %eax,(%edx) 
9. movl %ebx,(%ecx) 
10. movl -4(%ebp),%ebx 
11. movl %ebp,%esp 
12. popl %ebp 
13. ret
My guess:
Line 4 is saying from 0, move 12 up, grab that address and store it into ecx.
The same with line 5. So these are pretty much the xp and yp.
Line 6 and 7 are still extracting the addresses and then storing it into other registers. So these are t0 and t1.
But what's like 10 saying?

NVM the long picture. There are some things I think we didn't go over in that. So another question, if something like this appeared: $4,%edx, what does that mean? I can't find a site that explains this.
 
It is reading the carriage return.

You enter choice 2 by hitting '2<Enter>' on your keyboard. The scanf with %d reads the '2', leaving the '<Enter>' in the input buffer. The scanf with %c matches with the carriage return.

Use this instead:

Code:
scanf("%*[\n]%c", &str)

It will match only non-carriage return characters.
Couldn't he also just use scanf("%s", str)? It's easier to remember and will take all the characters between the initial and final carriage returns. At least, that's what I think he's doing since his second option says "Convert from binary format to a decimal integer" even though he's using "&c".

SenseiJinx said:
Personally, I prefer to use fgets when I'm reading in a string in C.
When I hear a reference to gets (even fgets) it cracks me up because the Linux man page specifically says to not use it (gets not fgets). I'm in a group project and one of the guys was using gets all over the place. I showed him the man page and he went back and reworked it so everything is using fgets. Felt bad since it wouldn't have mattered for our program but he did it anyway.
 

CronoShot

Member
Couldn't he also just use scanf("%s", str)? It's easier to remember and will take all the characters between the initial and final carriage returns. At least, that's what I think he's doing since his second option says "Convert from binary format to a decimal integer" even though he's using "&c".

Yeah, that's what I was trying. &c was a typo.

But when I try and use scanf("%s", str) I get this error:

Code:
warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char (*)[100]’
 

tokkun

Member
But what's like 10 saying?

Line 10 is restoring ebx from the location where it was pushed to the stack. It is the first value pushed in the stack frame, so it is always located at ebp - 4.

NVM the long picture. There are some things I think we didn't go over in that. So another question, if something like this appeared: $4,%edx, what does that mean? I can't find a site that explains this.

A $ followed by a number indicates an immediate value. MOVL $4 %edx means 'set the value of EDX to 4.' Values without dollar signs are addresses/offsets.
 

SonnyBoy

Member
I'm glad that I found this thread. I have zero experience programming and have just started to pick up Python, like yesterday. LOL Any advice is greatly appreciated.
 

moka

Member
I'm glad that I found this thread. I have zero experience programming and have just started to pick up Python, like yesterday. LOL Any advice is greatly appreciated.

STICK WITH IT.

Make random things, even if you think they're stupid and have already been done a billion times before. It's all about experience, finding problems, fixing problems and getting to grips with it. I know it sounds super cliché but just break shit man. That's how you learn.
 

SonnyBoy

Member
Python is great, especially for beginners!

Learn Python the Hard Way is one of the best tutorials:

http://learnpythonthehardway.org/book/

(And it's really not that hard, despite the title.)

I started with "Python in a day", per recommendation of a coworker. It's only 50 pages long and has been decent at providing what I assume to be a solid foundation. However, I will start on your recommendation directly afterward.


STICK WITH IT.

Make random things, even if you think they're stupid and have already been done a billion times before. It's all about experience, finding problems, fixing problems and getting to grips with it. I know it sounds super cliché but just break shit man. That's how you learn.

I'm so happy that you posted this... I feel like I don't have any idea of what I could make, or what I should make. Could you recommend something simple? Maybe that'll get me thinking in the right direction.
 

moka

Member
I'm so happy that you posted this... I feel like I don't have any idea of what I could make, or what I should make. Could you recommend something simple? Maybe that'll get me thinking in the right direction.

This website contains a nice list of little programs and stuff that you can make including walkthroughs.

It's separated by program type and programming language so you can always check out the other sections as well.
 
This website contains a nice list of little programs and stuff that you can make including walkthroughs.

It's separated by program type and programming language so you can always check out the other sections as well.

Stuff like that is definitely good to start with. Also, eventually you'll think "hey, it sure would be nice if I had a tool that could do X". Or you might have a cool idea for a website or a game or some random program. Then, make it! That's the best way to learn for me. When I don't have a huge amount of knowledge on a programming subject, I try to make something using that subject. Then the knowledge really sticks in your brain, and you have something cool to use and show off.

Also, try and start thinking of tedious things that you do in everyday life, or on the computer. Chances are there's a program you can come up with to make it easier.
 
Yeah, that's what I was trying. &c was a typo.

But when I try and use scanf("%s", str) I get this error:

Code:
warning: format &#8216;%s&#8217; expects type &#8216;char *&#8217;, but argument 2 has type &#8216;char (*)[100]&#8217;
Did you remove the ampersand in front of str? Because if not then you just gave scanf the address of a double pointer.
 

Tamanon

Banned
Man, after doing a decent amount of stuff in Python, I decided to dive into Ruby. Loving it thus far, but it's pretty weird. Wrapping my mind around the different way of doing things is pretty fun. Still in the early stages now, but I've got a big ol' tome to go through and try things with.
 

Onemic

Member
How important is Linux to programming?

Just asking because it's a course I'm taking in my Computer Programming and Analysis program and they say that eventually once you start working you pretty much have to be familiar with linux and how to use its terminal.
 

nan0

Member
How important is Linux to programming?

Just asking because it's a course I'm taking in my Computer Programming and Analysis program and they say that eventually once you start working you pretty much have to be familiar with linux and how to use its terminal.

That's a pretty bold statement. Unless they are using Linux in your program it's definitely not required for programming. If you stay in the Windows world (with .Net etc) or work for a company that just doesn't use Linux, you're fine without. But basic Linux skills are helpful in any case, since it's relatively easy to learn and open you a whole new field to work in. If you're doing something with e.g. Android or Linux-based webservers it's helpful if you know your way around the terminal and the basic OS.
 

tokkun

Member
How important is Linux to programming?

Just asking because it's a course I'm taking in my Computer Programming and Analysis program and they say that eventually once you start working you pretty much have to be familiar with linux and how to use its terminal.

Well, it's not so much that it's essential to programming, but rather that it can be a requirement for many jobs.

If you work at most big tech companies, you will have to program in a Linux environment, either directly in a Linux OS on your workstation or via a terminal connected to a Linux server using SSH, NX, etc. It's so expected at such companies that they will not even ask you about Linux during the interview process because they will assume you have those skills.
 
Yeah, Linux isn't required for becoming a good developer by all means. But like tokkun says, there is a large chance that at some point in your programming career you will be required to program in some sort of Unix environment.

Beyond that, there are certainly some benefits to programming in Linux (and why I prefer doing most development in Linux). While I prefer debugging in an IDE like Visual Studio, there's a lot of power to be had from developing with the command line tools you have in Linux or other Unix-variants.

There was a very good answer to a similar question on AskUbuntu the other day:

http://askubuntu.com/a/360170

The question was Ubuntu specifically, but that answer applies to Linux generally.
 

Water

Member
How important is Linux to programming?

Just asking because it's a course I'm taking in my Computer Programming and Analysis program and they say that eventually once you start working you pretty much have to be familiar with linux and how to use its terminal.
Maybe the crux of their point is not that you have to be familiar with Linux.

I have literally never seen a programmer who couldn't use command line tools at least at a basic level. That's a trivial skill, and I would be very alarmed if I ran into a programmer who was unfamiliar with it.

If you use OS X, you have the same command line tools there and need the same skills. If you use Windows, the default command line stuff is really awful but even then you have to be able to do the basics.
 

Onemic

Member
Ah, thanks for the advice. Just needed some justification to take the course seriously, as when I first started taking it I kept asking myself if it was just a course tacked on for first years just because, or if it actually is a useful skill to have.
 

KageZero

Member
Hello i started doing java for andorid (newboston and bringback tutorials on youtube) and now im stuck on this part with internalstorage and sharedpreferences, i can't load does activities.... I even tried to c/p his code now but that also doesn't work. Whenever i start the application on the emulator if i try to start it with a button onclick event the app crashes saying it couldn't start the intent but now when i set that one as the launcher in won't load instead it says : "[2013-10-18 17:29:13 - tutIntermediate] Installing tutIntermediate.apk...
[2013-10-18 17:30:12 - tutIntermediate] Success!
[2013-10-18 17:30:12 - tutIntermediate] \tutIntermediate\bin\tutIntermediate.apk installed on device
[2013-10-18 17:30:12 - tutIntermediate] Done!"
And i can't find it installed anywhere

Here are the codes and manifest
Code:
package com.example.tutintermediate;

import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;

public class Settings extends Activity implements OnClickListener {

	CheckBox cb;
	EditText et;
	Button b;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.settings);
		
		cb = (CheckBox) findViewById(R.id.checkBox1);
		et = (EditText) findViewById(R.id.editText1);
		b = (Button) findViewById(R.id.button1);
		b.setOnClickListener(this);
		loadPrefs();
	}
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	private void loadPrefs() {
		SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
		boolean cbValue = sp.getBoolean("CHECKBOX", false);
		String name = sp.getString("NAME", "YourName");
		if(cbValue){
			cb.setChecked(true);
		}else{
			cb.setChecked(false);
		}
		et.setText(name);
	}

	private void savePrefs(String key, boolean value) {
		SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
		Editor edit = sp.edit();
		edit.putBoolean(key, value);
		edit.commit();
	}

	private void savePrefs(String key, String value) {
		SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
		Editor edit = sp.edit();
		edit.putString(key, value);
		edit.commit();
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		savePrefs("CHECKBOX", cb.isChecked());
		if (cb.isChecked())
			savePrefs("NAME", et.getText().toString());
		
		finish();
	}

}

Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.tutintermediate"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        
        
        <activity
            android:name="com.example.tutintermediate.InternalStore"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.ISTORE" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.example.tutintermediate.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        
        
        <activity
            android:name="com.example.tutintermediate.Numberz"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.NUMBERZ" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        
        <activity
            android:name="com.example.tutintermediate.Settings"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.SETTINGS" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
 

phoenixyz

Member
Basic Linux skills are good to have generally. If Valve is successful in bringing gaming to Linux (to a greater extend) there's no reason to keep using Windows imo.
 

Onemic

Member
coincidentally I have a linux terminal question if you guys know how to answer it. I'm doing a lab and I have to type in a command that will display a listing of the directory /etc one screen at a time.

Now I would think that the command would be
Code:
 ls | more /etc
but the terminal keeps saying that the command is not correct. When displaying a hint it keeps telling me to use a combination of ls and more, which I have been using, but is not working. What am I doing wrong and what would be the correct command?
 
coincidentally I have a linux terminal question if you guys know how to answer it. I'm doing a lab and I have to type in a command that will display a listing of the directory /etc one screen at a time.

Now I would think that the command would be
Code:
 ls | more /etc
but the terminal keeps saying that the command is not correct. When displaying a hint it keeps telling me to use a combination of ls and more, which I have been using, but is not working. What am I doing wrong and what would be the correct command?

The /etc should go before the pipe.

Code:
ls /etc | more

The pipe literally "pipes" the output of one command to another. What you were doing was piping the output of an ls of whatever your current directory was to more, rather then /etc. The fix is to make sure you're piping the output of doing an ls on /etc.
 

nan0

Member
coincidentally I have a linux terminal question if you guys know how to answer it. I'm doing a lab and I have to type in a command that will display a listing of the directory /etc one screen at a time.

Now I would think that the command would be
Code:
 ls | more /etc
but the terminal keeps saying that the command is not correct. When displaying a hint it keeps telling me to use a combination of ls and more, which I have been using, but is not working. What am I doing wrong and what would be the correct command?

I don't exactly understand the assignment, but
Code:
ls /etc | more
works. Next screen is displayed with Spacebar.


Edit: Too late.
 
ah, I thought you can't pipe a directory/file to a command?

What you're doing is piping the output of "ls /etc" to another command. "ls /etc" just outputs text, which you can pipe into more.

Part of the Unix philosophy is a bunch of small tools that do one job really well, and that can communicate to each other through text. Thus the birth of pipes. =) (Which are awesome.) So "ls /etc" outputs text which you could pipe into literally any other tool that takes text as an input.
 

Onemic

Member
What you're doing is piping the output of "ls /etc" to another command. "ls /etc" just outputs text, which you can pipe into more.

Part of the Unix philosophy is a bunch of small tools that do one job really well, and that can communicate to each other through text. Thus the birth of pipes. =) (Which are awesome.) So "ls /etc" outputs text which you could pipe into literally any other tool that takes text as an input.

ah, stupid me. I don't know how I didn't realize that sooner.

Currently I'm doing my work through Putty(which i hear is shit, but I don't know what else to use) to access my school's Matrix server. I've been thinking about installing a distribution of linux to my laptop, so that I'll constantly be working in a linux environment and would therefore make working in terminal more natural for me instead of just accessing it whenever I have a project or lab. What distribution would you guys recommend me using? I only know of Ubuntu and Fedora. My school uses Gnome I believe. Is it possible to dual boot windows with linux?
 
ah, stupid me. I don't know how I didn't realize that sooner.

Currently I'm doing my work through Putty(which i hear is shit, but I don't know what else to use) to access my school's Matrix server. I've been thinking about installing a distribution of linux to my laptop, so that I'll constantly be working in a linux environment and would therefore make working in terminal more natural for me instead of just accessing it whenever I have a project or lab. What distribution would you guys recommend me using? I only know of Ubuntu and Fedora. My school uses Gnome I believe. Is it possible to dual boot windows with linux?

=O Wait, who says PuTTY is shit? It's got problems, but it's better then the majority of the other Windows SSH clients out there. It's also the most widely used.

As for a distro, it doesn't matter all that much at this point. I would recommend Ubuntu, personally, especially for a newcomer to Linux. And yeah, you can dual boot Windows and Linux, but it can be a bit of a pain.

EDIT: I also recommend checking out Cygwin. You can use it as an SSH client, but it also gives you a Linux-like commandline environment on Windows (without having to install Linux). It's pretty great.
 
ah, stupid me. I don't know how I didn't realize that sooner.

Currently I'm doing my work through Putty(which i hear is shit, but I don't know what else to use) to access my school's Matrix server. I've been thinking about installing a distribution of linux to my laptop, so that I'll constantly be working in a linux environment and would therefore make working in terminal more natural for me instead of just accessing it whenever I have a project or lab. What distribution would you guys recommend me using? I only know of Ubuntu and Fedora. My school uses Gnome I believe. Is it possible to dual boot windows with linux?
Dual boot is possible but you might want to try a distribution first in a virtual machine. Gnome is just a window manager like Aero is for Windows. As a beginner try Ubuntu or if you feel confident Debian. There is also a GAF Linux thread if you need help:http://m.neogaf.com/showthread.php?t=395852
 

Onemic

Member
=O Wait, who says PuTTY is shit? It's got problems, but it's better then the majority of the other Windows SSH clients out there. It's also the most widely used.


EDIT: I also recommend checking out Cygwin. You can use it as an SSH client, but it also gives you a Linux-like commandline environment on Windows (without having to install Linux). It's pretty great.

A few people in my C programming class :p

Dual boot is possible but you might want to try a distribution first in a virtual machine. Gnome is just a window manager like Aero is for Windows. As a beginner try Ubuntu or if you feel confident Debian. There is also a GAF Linux thread if you need help:http://m.neogaf.com/showthread.php?t=395852

As for a distro, it doesn't matter all that much at this point. I would recommend Ubuntu, personally, especially for a newcomer to Linux. And yeah, you can dual boot Windows and Linux, but it can be a bit of a pain.


Great, I was thinking of using Ubuntu anyways, especially since I heard a new version came out. What makes dual-booting Linux with Windows hard? I guess since it's going to be my laptop that I'll be installing it on and I only use it for school I could just do a fresh format and install, but I'd just like to have Windows on the side in case anything goes wrong.

Can you use Visual Studio with Linux or is that Windows only?
 

NotBacon

Member
ah, stupid me. I don't know how I didn't realize that sooner.

Currently I'm doing my work through Putty(which i hear is shit, but I don't know what else to use) to access my school's Matrix server. I've been thinking about installing a distribution of linux to my laptop, so that I'll constantly be working in a linux environment and would therefore make working in terminal more natural for me instead of just accessing it whenever I have a project or lab. What distribution would you guys recommend me using? I only know of Ubuntu and Fedora. My school uses Gnome I believe. Is it possible to dual boot windows with linux?

Burn a stable Ubuntu .iso to a usb drive. Boot from it and check it out for a while and explore.

Once you realize it 's awesome, backup all your files, fresh Ubuntu install. (Or Ubuntu-GNOME, Ubuntu-XFCE, Mint, Fedora, Debian, OpenSUSE, Arch, etc.)

A few people in my C programming class :p

Great, I was thinking of using Ubuntu anyways, especially since I heard a new version came out. What makes dual-booting Linux with Windows hard? I guess since it's going to be my laptop that I'll be installing it on and I only use it for school I could just do a fresh format and install, but I'd just like to have Windows on the side in case anything goes wrong.

Can you use Visual Studio with Linux or is that Windows only?

Putty is pretty bad compared to an actual Terminal. Dual-booting isn't difficult, but it would be best to first fresh install windows, size partitions during that, then install ubuntu, then deal with keeping them happy together. It's just a hassle, but it is how i started too. After about a month I wiped Windows clean off my laptop and never looked back. You'll eventually realize there's a version or equivalent to every windows program on linux. Exceptions are windows specific software: MSOffice, VS, etc.
 

Tamanon

Banned
I didn't even realize non-network guys used PuTTy. All I use it for is networking. Easiest way to get on a Cisco router without using the SDM.
 
I didn't even realize non-network guys used PuTTy. All I use it for is networking. Easiest way to get on a Cisco router without using the SDM.

Every job I've worked my coworkers and I have all used PuTTY. (Would have preferred to just work on Linux, but there were Windows programs we needed as well.) Never had any real problems with it, to be honest.
 

tokkun

Member
Great, I was thinking of using Ubuntu anyways, especially since I heard a new version came out. What makes dual-booting Linux with Windows hard?

The main headache for dual-booting is properly setting up your bootloader. That's the piece of code that is run when your computer starts up that asks you which OS you want to boot.

Linux uses a bootloader called GRUB. Windows uses one called BOOTMGR. You need to choose one and configure it to be able to boot an OS of the other type.

Both of them are somewhat difficult to configure correctly if you are not experienced, especially if your system has multiple hard drives. Since Windows Vista, Windows has been fairly hostile to dual-booting. When you install Windows, it will replace GRUB with BOOTMGR without asking, locking you out of your Linux OS. Getting BOOTMGR itself to support a non-Windows OS requires you to move the GRUB loader manually and edit BOOTMGR with a third-party application like EasyBCD.

It seems like at least once a year I have to boot a GRUB rescue live CD and manually reinstall GRUB.

Therefore, if you are working on a desktop machine where RAM is cheap and plentiful, I would strongly recommend installing Windows as your base OS and installing Linux in a virtual machine. If you are more security-minded and don't care about things like games, you could also do the reverse.
 

Onemic

Member
Burn a stable Ubuntu .iso to a usb drive. Boot from it and check it out for a while and explore.

Once you realize it 's awesome, backup all your files, fresh Ubuntu install. (Or Ubuntu-GNOME, Ubuntu-XFCE, Mint, Fedora, Debian, OpenSUSE, Arch, etc.)



Putty is pretty bad compared to an actual Terminal. Dual-booting isn't difficult, but it would be best to first fresh install windows, size partitions during that, then install ubuntu, then deal with keeping them happy together. It's just a hassle, but it is how i started too. After about a month I wiped Windows clean off my laptop and never looked back. You'll eventually realize there's a version or equivalent to every windows program on linux. Exceptions are windows specific software: MSOffice, VS, etc.

So VS won't work with Linux? Damn.

What's the closest Linux equivalent of VS?(in terms of interface and all that)
 
So VS won't work with Linux? Damn.

What's the closest Linux equivalent of VS?(in terms of interface and all that)
^Does Eclipse work with C? If not Code::Blocks is another big one. I honestly just use a terminal with vi and syntax highlighting and gdb.

Honestly, I jumped into Linux earlier this year with Ubuntu but I started noticing the bugs so I jumped into Crunchbang. I recommend you do the same. Ubuntu is good in its own right but it's great as a buffer between Windows and other distros. I hated Crunchbang at first but I wouldn't trade it for another distro or OS now.
 
Top Bottom