![]() |
|
#1
|
|||
|
|||
converting binary to integer...Hello all!
This being my first post at this forum, let me say I hope I can get the assistance that I need to complete this programming portion of my senior seminar project of the bachelors degree for Computer Science. On to my question... I found some code that I was going to mod to use for my program and I have a few questions about this code that I found. This is what I've got so far.... CPP / C++ / C Code:
Last edited by dsmith : 09-Feb-2004 at 21:40.
Reason: Added C syntax highlighting
|
|||
|
#2
|
||||
|
||||
|
Your problem is with the line previous to that one and it is actually not needed.
Try to comment it out first as so: CPP / C++ / C Code:
CPP / C++ / C Code:
The reason that it is not needed is that it is a function definition, but main is always included in c so it does not need to be defined. However, if it is defined here it needs a semicolon after it. Quote:
This is fine. It is simply defining that the return value of the function is an unsigned int and that it needs a pointer to an integer passed to it. BTW- where did you come up with your forum name? Thats alot of numbers! ![]() |
|
#3
|
|||
|
|||
|
ah yes...THANKYOU SO MUCH. Got that BS message out of the way...and led to another...the inevitable "link error: undefined symbol: _main in maincrt.c"...aww nuts.
The numbers in my name? TRU is the name of my favorite rap group (master p, silkk the shocker and c-murder), 504 is the name of another favorite group (also composed partially of master p), 211 is the police code for armed robbery, and 187 is the code for homicide...more than you expected? lol, Thanx again...if you know what this link error is lemme know, but I've never actually solved a link error before! |
|
#4
|
||||
|
||||
|
Okay, I think I understand your original post a little more. The code snippet that you downloaded is a function. It does absolutely nothing unless called from another function.
As I explained earlier, main is the entry function. This is basically where your program starts from and then it calls other functions as needed. C is basically just a grouping of functions that call each other. You can do everything in the main function if you want, but not only is this hard to track & read, it becomes impossible for bigger programs. So basically, you need to write your own main function. For example: CPP / C++ / C Code:
Thats a pretty stupid main function, but it should compile and you can take it from there. |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The