Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programming in Unix [SOLVED]
New Posts  All Forums:Forum Nav:

Programming in Unix [SOLVED]

post #1 of 11
Thread Starter 
I use Visual Studio 2010 for C++/C# but what would I use (in windows) for C and Unix?

I think at my school we have SSH for Unix but I don't really know. I haven't learned Unix yet and we haven't really gotten into the coding.

Also, any tutorial sites would be great.

Thanks, K10
Skylake
(10 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core-i7 6700K ASUS ROG Maximus VIII Hero EVGA GTX 970 4GB G.SKILL Ripjaws 4 32GB DDR4 2800 
Hard DriveHard DriveCoolingOS
SAMSUNG SM951 M.2 SAMSUNG 850 EVO Corsair H100i Windows 10 
PowerCase
SeaSonic G-750 Fractal Design Define R4 
  hide details  
Reply
Skylake
(10 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core-i7 6700K ASUS ROG Maximus VIII Hero EVGA GTX 970 4GB G.SKILL Ripjaws 4 32GB DDR4 2800 
Hard DriveHard DriveCoolingOS
SAMSUNG SM951 M.2 SAMSUNG 850 EVO Corsair H100i Windows 10 
PowerCase
SeaSonic G-750 Fractal Design Define R4 
  hide details  
Reply
post #2 of 11
Quote:
Originally Posted by K10 View Post
I use Visual Studio 2010 for C++/C# but what would I use (in windows) for C and Unix?

I think at my school we have SSH for Unix but I don't really know. I haven't learned Unix yet and we haven't really gotten into the coding.

Also, any tutorial sites would be great.

Thanks, K10
What do you mean by "Unix"?

For C in windows I would use MinGW.
post #3 of 11
Thread Starter 
Quote:
Originally Posted by xtascox View Post
What do you mean by "Unix"?
I don't really know. I know next to nothing about it. I guess for writing scripts or maybe just command-line stuffs?

Quote:
For C in windows I would use MinGW.
Okay, I'll wait for other replies and I'll see what comes up most frequently.

+rep
Skylake
(10 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core-i7 6700K ASUS ROG Maximus VIII Hero EVGA GTX 970 4GB G.SKILL Ripjaws 4 32GB DDR4 2800 
Hard DriveHard DriveCoolingOS
SAMSUNG SM951 M.2 SAMSUNG 850 EVO Corsair H100i Windows 10 
PowerCase
SeaSonic G-750 Fractal Design Define R4 
  hide details  
Reply
Skylake
(10 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core-i7 6700K ASUS ROG Maximus VIII Hero EVGA GTX 970 4GB G.SKILL Ripjaws 4 32GB DDR4 2800 
Hard DriveHard DriveCoolingOS
SAMSUNG SM951 M.2 SAMSUNG 850 EVO Corsair H100i Windows 10 
PowerCase
SeaSonic G-750 Fractal Design Define R4 
  hide details  
Reply
post #4 of 11
Windows wise if you are already using VS C++ for compiling C++ applications you can compile c also. As for unix I am also a little confused as to what you are asking if you are looking for command line compilers then cc should work i think if you want to do it from windows I would probably suggest a virtualbox virtual machine of whatever unix system you would like to work in then play around.

link for VS C compiling
    
CPUMotherboardGraphicsRAM
Q6600 DG33TL XFX 6950 2GB 4gigs Corsair XMS2 DDR2 
Hard DriveOptical DriveOSMonitor
1.5TB seagate 2X640GB Samsung DVDRW Windows Vista & Debian Linux Samsung 19" + Acer 24" Wide 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Antec 750 TruePower Raidmax Smilodon COOLER MASTER Sentinel 
Mouse Pad
RocketFish 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q6600 DG33TL XFX 6950 2GB 4gigs Corsair XMS2 DDR2 
Hard DriveOptical DriveOSMonitor
1.5TB seagate 2X640GB Samsung DVDRW Windows Vista & Debian Linux Samsung 19" + Acer 24" Wide 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Antec 750 TruePower Raidmax Smilodon COOLER MASTER Sentinel 
Mouse Pad
RocketFish 
  hide details  
Reply
post #5 of 11
Eclipse IDE pretty much handles all langs
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 Asus Lappy GeForce GT520M 4096 
Hard DriveOptical DriveOSMonitor
500GB LG W7=64 ult + Slackware13.1_64 + MineOS HP w2207h 
KeyboardCaseMouse
logitech G11 Fugly, lol logitech mx518 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 Asus Lappy GeForce GT520M 4096 
Hard DriveOptical DriveOSMonitor
500GB LG W7=64 ult + Slackware13.1_64 + MineOS HP w2207h 
KeyboardCaseMouse
logitech G11 Fugly, lol logitech mx518 
  hide details  
Reply
post #6 of 11
Well are you looking for an IDE or just a compiler?

If a compiler use GCC, and you already have Visual Studio as an IDE. You could also use BlueJ or Eclipse.

I don't really know what you mean by coding "Unix". I'm guessing you want to make your own Unix based OS, or you want to learn basic Unix/Linux commands? Can't really help you here unless you make it a bit more clear.
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7-930 D0 3.8Ghz ASUS P6T SE PowerColor HD5870 1GB 6GB Corsair Dominator XMS3 8-8-8-20 1200Mhz 
Hard DriveOSMonitorPower
1TB Wester Digital Windows 7 Home 64bit Acer 23" XFX 850w Black Edtion 
Case
HAF 932 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Core i7-930 D0 3.8Ghz ASUS P6T SE PowerColor HD5870 1GB 6GB Corsair Dominator XMS3 8-8-8-20 1200Mhz 
Hard DriveOSMonitorPower
1TB Wester Digital Windows 7 Home 64bit Acer 23" XFX 850w Black Edtion 
Case
HAF 932 
  hide details  
Reply
post #7 of 11
You can use Visual Studio 2010 so you don't need anything new.
Heres a link to a vid
C-Language-Programming-with-Visual-Studio-2010
    
CPUMotherboardGraphicsRAM
I7 920 Gigabyte EX58 XFX Radeon 4870 X2 6GB Corsair 
Hard DriveOptical DriveOSMonitor
500GB Maxtor LG DVDRW Vista Ultimate x64 2 x Edge IO 22" 
KeyboardPowerMouseMouse Pad
Razer Arctosa XFX 800w BTC Cheetah Gaming Mouse None 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
I7 920 Gigabyte EX58 XFX Radeon 4870 X2 6GB Corsair 
Hard DriveOptical DriveOSMonitor
500GB Maxtor LG DVDRW Vista Ultimate x64 2 x Edge IO 22" 
KeyboardPowerMouseMouse Pad
Razer Arctosa XFX 800w BTC Cheetah Gaming Mouse None 
  hide details  
Reply
post #8 of 11
Code::Blocks is a nice IDE for writing C in windows.
GAMR
(15 items)
 
  
CPUMotherboardGraphicsGraphics
6600K ASUS Z170-A ASUS 970 Strix ASUS 970 Strix 
RAMHard DriveHard DriveHard Drive
Crucial Ballistix Elite Samsung 850 EVO Intel 320 6400AAKS 
Hard DriveCoolingMonitorPower
6400AAKS Cooler Master Hyper 212 EVO ASUS VG24QE EVGA SuperNova 650 G2 
CaseMouseMouse Pad
Antec 1200 Razer Abyssus 3.5G QCK+ 
  hide details  
Reply
GAMR
(15 items)
 
  
CPUMotherboardGraphicsGraphics
6600K ASUS Z170-A ASUS 970 Strix ASUS 970 Strix 
RAMHard DriveHard DriveHard Drive
Crucial Ballistix Elite Samsung 850 EVO Intel 320 6400AAKS 
Hard DriveCoolingMonitorPower
6400AAKS Cooler Master Hyper 212 EVO ASUS VG24QE EVGA SuperNova 650 G2 
CaseMouseMouse Pad
Antec 1200 Razer Abyssus 3.5G QCK+ 
  hide details  
Reply
post #9 of 11
one of my peers is taking a C++ course(as they teach us mainly in java) at my college; he's in the exact same situation you're in.

i wouldn't suggest programming C in a windows enviroment if your class requires u program in unix... he told me his code never transfers very well, there would be several compiling errors, endless loops, outOfBound errors that crop up; he said something about them using different data-type sizes

so he's at school a lot more using the UNIX machines lol... a possibility is dual booting windows and unix
my aging rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k MSI P67A-G43 HIS Radeon HD 6870 8gb G.Skill DDR3 1333Mhz 
Hard DriveOptical DriveOSMonitor
WD Sata2 500gb Lite-On DVD drive Win7 ASUS 21.5inch 
KeyboardPowerCaseMouse
Razer BlackWidow Ultimate Antec CP 850 Antec p183 SteelSeries Ikari laser 
Mouse Pad
Razer Destructor 
  hide details  
Reply
my aging rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k MSI P67A-G43 HIS Radeon HD 6870 8gb G.Skill DDR3 1333Mhz 
Hard DriveOptical DriveOSMonitor
WD Sata2 500gb Lite-On DVD drive Win7 ASUS 21.5inch 
KeyboardPowerCaseMouse
Razer BlackWidow Ultimate Antec CP 850 Antec p183 SteelSeries Ikari laser 
Mouse Pad
Razer Destructor 
  hide details  
Reply
post #10 of 11
If you want to become a diehard UNIX and C programmer, use vi and the command line lol.

Here's how I do my work as a CS student:

I either work directly at a linux machine at school, where I compile my programs from the command line, using the gcc compiler. As for writing my programs, I usually just use a text editor because I really suck at using vi (I guess I'm not diehard). On Linux, gedit will color-code the programs and what not I write, like an IDE would. If you're working on a linux machine, you most likely will not be using an IDE that will compile your programs for you by clicking an icon. If you're working on your own machine that runs Windows, feel free to use an IDE, but if you want to really understand what's going on, you gotta get your hands dirty. To really understand what's going on at a deeper level, you gotta be working on the command line for a first-hand experience. That is why schools tend to make the students work from the command line. You won't learn by just clicking icons.

If I'm at home, I'm on my OSx86 setup, so basically doing the same thing: terminal to compile, a text editor to write code.

You can ssh into a unix/linux machine at your school (I assume) and in that case, you would be doing everything from the command line. You'd be compiling just as you normally would, but you would have to write/edit your code in something like vi or emacs since you don't have the GUI to use a text editor like gedit or something.

vi is pretty powerful for a text editor but it just requires a bit of practice to become efficient at.

I'm not sure if I've answered your question really, just trying to give out general information

Here's the basic steps to writing a program, compiling, and running it from the command line:

1.) Open terminal
2.) Typing "ls" will list the contents of the directory you're in. In my case, it's my home directory
3.) I want to navigate into my Documents, so I enter "cd Documents/" (cd = change directory).
4.) I want to save my file that contains my code here, so I create a new file using vi. I type "vi myProg.c" where "vi" is the command to start vi and "myProg.c" is the name of the file I want. Make sure you save it as .c



5.) Once I enter "vi myProg.c", vi starts and it changes my terminal window into what you see below but it'll be blank until you type text.
6.) To begin inserting text, hit "ESC" and then "i". You'll see "INSERT" at the bottom left, indicating you're in insert mode and can modify the file.
7.) Type your code
8.) To save and exit, hit "ESC" again and then ":wq" (write and quit).



9.) Once you save and quit from vi, you'll be brought back to your previous terminal screen.
10.) Type "ls" again and notice that "myProg.c" is now listed in the current directory
12.) To compile the program, type "gcc myProg.c"
12.) If it compiles without error, you'll get another command prompt. If you have errors, it'll tell you (so if you compile and don't see any message, you're good to go as far as syntax errors).
13.) Type "ls" again and you'll see that we now have our executable file "a.out".
14.) To run that executable, type "./a.out"
15.) Note the output



This is the most basic of cases and just illustrates the general idea. Googling and looking around will definitely show you more.
Edited by Tomiger - 1/22/11 at 11:22pm
 
Mineral Oil PC
(7 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 4790K Devil's Canyon 4.0GHz ASUS Sabertooth Z97 Mark S (White) Zotac GTX 760 Avexir Raiden 16GB DDR3 
Hard DriveCoolingCoolingCooling
OCZ Trion 240GB XSPC Raystorm Pro (white) XSPC EX 240 (white) XSPC EX 360 (white) 
CoolingCoolingCoolingCooling
Swiftech MCP655 Monsoon Dual Bay Reservoir Monsoon Modular Tube Reservoir Monsoon Stand Alone Pump Top/Cover 
CoolingPower
EK GTX 970 Water Block Corsair AX760i 
CPUMotherboardGraphicsGraphics
Intel Core i7 2600K Sandy Bridge 3.4 GHz Gigabyte GA-P67A-UD4-B3 GTX 285 GTX 285 
RAMHard DriveHard DriveCooling
Corsair Vengeance 16GB Western Digital 1TB Western Digital 250GB EK-Supremacy Clean CSQ - Nickel 
CoolingCoolingCoolingCooling
XSPC RX 360 XSPC EX 360 (cross flow) FrozenQ T-virus Reservoir EK Waterblock GTX 285 
Cooling
Swiftech MCP655 
  hide details  
Reply
 
Mineral Oil PC
(7 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 4790K Devil's Canyon 4.0GHz ASUS Sabertooth Z97 Mark S (White) Zotac GTX 760 Avexir Raiden 16GB DDR3 
Hard DriveCoolingCoolingCooling
OCZ Trion 240GB XSPC Raystorm Pro (white) XSPC EX 240 (white) XSPC EX 360 (white) 
CoolingCoolingCoolingCooling
Swiftech MCP655 Monsoon Dual Bay Reservoir Monsoon Modular Tube Reservoir Monsoon Stand Alone Pump Top/Cover 
CoolingPower
EK GTX 970 Water Block Corsair AX760i 
CPUMotherboardGraphicsGraphics
Intel Core i7 2600K Sandy Bridge 3.4 GHz Gigabyte GA-P67A-UD4-B3 GTX 285 GTX 285 
RAMHard DriveHard DriveCooling
Corsair Vengeance 16GB Western Digital 1TB Western Digital 250GB EK-Supremacy Clean CSQ - Nickel 
CoolingCoolingCoolingCooling
XSPC RX 360 XSPC EX 360 (cross flow) FrozenQ T-virus Reservoir EK Waterblock GTX 285 
Cooling
Swiftech MCP655 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programming in Unix [SOLVED]