Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Need help making interface look like C language(In school the C framework looks different in Eclipse than what my class is using)
Need help making interface look like C language [message #1832215] Sat, 12 September 2020 14:34 Go to next message
Michael Huettel is currently offline Michael HuettelFriend
Messages: 2
Registered: September 2020
Junior Member
I am beginner using macOS Catalina and have been looking for an IDE that is simple for me and yet can do those things needed in my class. I found Eclipse to be the best option with lots of positive reviews. However, I downloaded the program and opened up the Hello World file and it looked like this:
/*
============================================================================
Name : test.c
Author :
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/

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

int main(void) {
puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
return EXIT_SUCCESS;
}



-----------------------------------------
In class what we are learning are things like this:

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

int main()
{
printf("Hello world!\n");
return 0;
}


My QUESTION: How do I change the Eclipse language to use Printf() and return 0 and stuff like that?
Re: Need help making interface look like C language [message #1832218 is a reply to message #1832215] Sat, 12 September 2020 18:13 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
This is actually a bit off-topic for Eclipse, it is a plain C question.

The program provided by Eclipse is correct. There are many ways to skin a cat.

Please get a tutorial on the C language and learn the constructs used in the Eclipse example. It is not a purpose of an IDE to write the code for you - you have to do it yourself.


--

Tauno Voipio
Re: Need help making interface look like C language [message #1832223 is a reply to message #1832218] Sat, 12 September 2020 19:35 Go to previous messageGo to next message
Michael Huettel is currently offline Michael HuettelFriend
Messages: 2
Registered: September 2020
Junior Member
Wow what a nice warm friendly response. I don't think I was saying the Eclipse example was incorrect, I was merely wondering how I can make Eclipse start a new file with the construct that my school is using. Meaning to use the printf() and return 0 etc.....

I have seen other IDE's such as Codeblock's make a new file with a layout using the frame work with the printf() stuff for the hello example so I was wondering how to get Eclipse to do the same thing for new files. This way I don't have to delete and retype everything as a starting point. I don't want to use another IDE, I was just wondering how to get it to work like that in Eclipse so I can use it instead.

Also, I certainly don't expect Eclipse to code for me either as I understand that I will have to that myself as I learn. However, learning the Eclipse examples is contradictory to my instructors teachings so I would much rather get my IDE interface to work for me instead of against me. Or are you saying Eclipse doesn't use the printf() etc? If that is what you are trying to say then I understand and now realize the Eclipse IDE won't work for me.

But thank you for the response.

best regards, Michael
Re: Need help making interface look like C language [message #1832226 is a reply to message #1832223] Sat, 12 September 2020 22:38 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
The template is stored under (in my installation, at least)
<eclipse directory>/configuration/org.eclipse.osgi/958/0/.cp/templates/projecttemplates/HelloWorldCAnsiProject/src/Basename.c .
You likely can modify it.
You may have to search for HelloWorldCAnsiProject in the file path names.
The actual path changes with differing Eclipse releases.

<eclipse directory> is where Eclipse is installed.
In my system it is at /opt/eclipse/<release>.
May not be the same in your installation.


The real purpose is not to generate a starting source but to generate a working executable project.
It really shouldn't matter what the sample source actually is or does.
It just has to compile and execute.
Not sure what the point would be in changing it other than aesthetics.
Unless you want every program you write to print "Hello World" then you will have to delete that part of the sample anyway.

Quote:
are you saying Eclipse doesn't use the printf() etc?

Eclipse is an editor with frills.
Editors don't really care about or use what is being edited.
One of the frills in CDT, though, is a syntax checker.
It obviously cares about the content.

[Updated on: Sat, 12 September 2020 23:20]

Report message to a moderator

Previous Topic:Remote Debug Startup with Linux on iMX8M
Next Topic:How to get ICProject out of IProject?
Goto Forum:
  


Current Time: Fri Oct 11 16:09:28 GMT 2024

Powered by FUDForum. Page generated in 0.03828 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top