Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
41 user(s) are online (26 user(s) are browsing Forum)

Members: 0
Guests: 41

more...


Browsing this Thread:   1 Anonymous Users




« 1 (2)


Re: Let`s learn how to code in C!
#8
Home away from home
Home away from home


See User information
Does the K and R book go into depth about the C language?

Posted on: 2018/6/17 23:21
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Let`s learn how to code in C!
#7
Quite a regular
Quite a regular


See User information
Err, if you enter "the c programming language kernighan" into our friend google, you might find that assuming you get the same results as me, the second link is not expensive at all !!

Whether it is entirely legal or not is not for me to judge or condone one way or another - just passing on what google is giving.

[EDIT] But you are correct, in paperback, I do remember it being a lot of money for me back when i was in my late 20's - probably explains why i laminated the covers and looked after it all this time.

Posted on: 2018/6/17 22:00
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Anonymous
Re: Let`s learn how to code in C!
#6
Actually I don't have much money to buy expensive Books!

But google is your friend:

https://www.google.de/search?q=C+Coding+Manual&rlz=1C1CHBF_deDE798DE798&oq=C+Coding+Manual&aqs=chrome..69i57j69i64l3.8799j0j7&sourceid=chrome&ie=UTF-8

 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Let`s learn how to code in C!
#5
Quite a regular
Quite a regular


See User information
The C compiler does not understand different human languages, only it's own - the C language. In C a float has a '.' for the decimal point, as it does in maths in general so I'm afraid that if you want to add two floats you need to enter them with the dot for the decimal place.

So, how do you handle the different language formats for numbers (called a Locale)?

You need to enter the value as a string or more technically an array of chars and then YOU have to process that string to convert it to the standard numeric format that the compiler is expecting to receive. There will be more than 1 way to do that, you could do it manually by looping over the string to replace the ',' with a '.' and then convert the string to a number, or no doubt there are library functions in the C language that will convert the string to a float taking into account the input locale (I genuinely don't know off hand). But the point is, if you want to enter two numbers in your own locale you will have to convert them. The C compiler won't understand them as-is.

If you are serious about learning C then I would highly recommend buying a copy of "The C Programming Language" by Brian Kernighan and Dennis Ritchie (RIP). It is widely respected as the "go-to" book on the subject. I bought a copy when I was at night school in the mid 90's and it is still next to my desk all these years later.

There are some aspects of C that will likely fry your brain at first (pointers and the like). If you're really lucky you'll get it quickly, if not, having the book handy will be helpful. I need it around from time to time because at the moment I do not work in C for a living (I used to around 2000 and also from 2012 - 2016). I also do not know if there are translated versions in, for example German or if that is even a problem?

Posted on: 2018/6/17 17:28
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Let`s learn how to code in C!
#4
Home away from home
Home away from home


See User information
Cool.
I hope it goes well.

Posted on: 2018/6/17 4:11
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Anonymous
Re: Trying to learn how to Code!
#3
Bump! *lol*

I have no clue how to solve that!
I can enter Numbers in the format 3.14 but I don't know how to code it that I can enter 3,14 in german format!

I have a friend that teaches me a little!

If others here want to learn how to Program in c.. they can install vbcc Compiler on Amiga OS 3.1 and WinUAE and use this thread for Discussion!

 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Anonymous
Re: Trying to learn how to Code!
#2
Solved!

Both Codes are correct!

I found the Error you have to compile with the -lmieee Option

Compile Command:
vc -o microadd.exe microadd.c -lmieee

then it works!

 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Anonymous
Let`s learn how to code in C!
#1
Hello I have written a small Addition Program for Amiga Computers.. I managed that it runs with Integer but I don't know how to manage float Operations with vbcc!

This Code works:

#include <stdio.h>
int main(void) {
  
int aint bint res;
  
printf("\n\nWelcome to Amiga Micro Add V.0.0.1\n\n"); 
  
printf("\nPlease enter a Number for Addition : ");
  
scanf("%d",&a);
  
printf("\nPlease enter a second Number for Addition: ");
  
scanf("%d",&b);
  
res b;
  
printf("\nThe result is: %d\n"res);
  return 
0;
}


But this don't:

#include <stdio.h>
#include <stdlib.h>
int main(void) {
  
float afloat bfloat res;
  
printf("\n\nWelcome to Amiga Micro Add V.0.0.2\n\n");
  
printf("\nPlease enter a Number for Addition : ");
  
scanf("%f",&a); printf("\nPlease enter a second Number for Addition: ");
  
scanf("%f",&b);
  
res b;
  
printf("\nThe result is: %f\n"res);
  return 
0;
}


The VBCC Compiler complains: Error 21 Reference to undefined symbol __ieees2d. vlink error

I did it with WinUAE configured with a 68040 CPU!


Edited by AROS-Confidence1 on 2018/6/17 0:27:13
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 




« 1 (2)



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project