(Topic ID: 309660)

Son needs help w/"C" Programming assignment. Tutor needed (fast)

By iamabearsfan

2 years ago


Topic Heartbeat

Topic Stats

You

Linked Games

No games have been linked to this topic.

    Topic Gallery

    View topic image gallery

    CBook (resized).jpg
    2022-02-1721.37.223380997622096685046.jpg
    20220217_202134 (resized).jpg
    popular-programming-languages.gif
    Screen Shot 2022-02-08 at 10.24.00 AM (resized).png
    There are 68 posts in this topic. You are on page 1 of 2.
    #1 2 years ago

    This is a last ditch effort, but son at school struggling with C assignment. Doesn't compile. Anyone want to see if they can help that knows "C" well? I would be willing to pay for the help to get him over the hump. His TA isn't available and assignment due tonight.

    I know this is a stretch post, but thought maybe someone out in the Pinside world knows C. This is a college level class btw.

    #2 2 years ago

    Post the question and compiler/linker errors and we'll have at it.

    #3 2 years ago

    What are the errors he is getting? Post those, and I might be able to tell you what's wrong.

    #4 2 years ago

    Start at the top, and work his way down. Might be missing a semicolon, and breaking other stuff later. Also count curly braces, and make sure each opening one matches the correct closing one.

    #5 2 years ago

    Mostly with C if it is a linker error the external function cannot be found and needs the .h header file included where the call is made or I guess the external dll needs to be imported where the call is made. Header inclusion must be properly ordered as well relative to other headers. All C functions are global, it actually is the reason C++ needs to deal with global functions, because C came first. All newer invented languages are in class implemented and encapsulated. Why are they still teaching C then? To segue into C++?

    #6 2 years ago
    Quoted from unclerudy:

    Start at the top, and work his way down. Might be missing a semicolon, and breaking other stuff later. Also count curly braces, and make sure each opening one matches the correct closing one.

    Something like that would show up as a massive amount of compiler errors.

    #7 2 years ago

    I passed this info on. I myself cut my teeth on Assembler and Cobol. Am I dating myself?

    I still don't know why they require C at this point. Seems like it is nothing but a way to kick the kids asses and see who is still standing. Unfortunately for my son, I think he might be going to plan B at this point. Feel bad for him

    #8 2 years ago

    I think that last time Cobol programmers were needed in force was for Y2K issues with existing Cobol programs? I think Cobol programmers were raking it in around the year 2000.

    #9 2 years ago

    As the director of SW development I can tell you we need more C/C++ developers in this world!! You can’t beat the language for pure performance.

    Tell him if he likes nice things in life - like pinball machines - stick it out! My first two years in college kicked my ass big time in computer science. Looking back I am SOO glad I powered through.

    11
    #10 2 years ago

    Just got done talking with your son. Hopefully I was able to point him in the right direction. I was able to tell him how to fix it, but not make it work. That would require more effort than I have time at the moment. But if he takes my advice, he will get more than a zero.

    #11 2 years ago

    Maybe I can help . Can you send the code and what error you are getting and I can see if I can get it going for him.

    #12 2 years ago

    I learned C in 1986 in a summer job during high school. I was supposed to be translating Latin documents but my forte was on the technical side! At University of Toronto.

    #13 2 years ago

    Quick update. He was able to get the code working (kind of). At least he won't get a zero on the assignment. Thanks for the pointers! Appreciated.

    #15 2 years ago

    I have a general question about "C". How much is it really used in the wild anymore? Everything I hear is he should be focussing on .NET languages like C#. Is that still true?

    He is a Computer Engineering major and they have the kids focussing on these lower level languages. Curious is the curriculum is current with the times.

    #16 2 years ago
    Quoted from iamabearsfan:

    I have a general question about "C". How much is it really used in the wild anymore? Everything I hear is he should be focusing on .NET languages like C#. Is that still true?
    He is a Computer Engineering major and they have the kids focusing on these lower level languages. Curious is the curriculum is current with the times.

    It depends on the career path that he wants to go into. C is a commonly used language in the auto industry. Everything embedded is done in C. Some things might be model based, but they are converted into C when putting them on a micro. Once you learn how to code, you can then learn languages that you want to use after that. I just got a Masters degree in December in Electric Drive Vehicle Engineering, and one of the classes I took was a C programming class. C is not a lower level language. It is actually one of the better languages to use on embedded systems, where there is a limited amount of memory, the inputs and outputs are all defined, and there is no dynamic allocation of new structures or memory cleaning needed. Pretty much anything that is car related, that doesn't need a user interface, is done in C.

    Now if your son wants to work in IT, doing IT programming, C is useless. Or web design. Same thing. Pretty much anything running on dynamic computer targets, where the resources are unknown, C is not going to be the language used. But as I said, if you know C, you can apply all of the concepts, and much of the syntax, into the language that you are using.

    #17 2 years ago
    Quoted from iamabearsfan:

    He is a Computer Engineering major and they have the kids focussing on these lower level languages. Curious is the curriculum is current with the times.

    computer engineering is assembly, c, and vhdl/verilog. love it or leave it

    #18 2 years ago

    C still #2 -- https://www.tiobe.com/tiobe-index/

    I've been programming in it full time for the past 2 years, enjoying it!

    #19 2 years ago

    This is going way back to 1987. I loved C. It could be used as either a low level or high level language. Back in the day, it was the language. COBOL, Pascal and Fortran were kinda going out. ADA was new.

    #20 2 years ago
    Quoted from iamabearsfan:

    He is a Computer Engineering major and they have the kids focussing on these lower level languages. Curious is the curriculum is current with the times.

    C is a helpful introduction to other C-based languages like Java, C#, C++, javascript, PHP, Python, etc. The more interesting stuff is probably happening with those higher-level languages, though, so if he continues with programming, C is not going to be the stopping point.

    #21 2 years ago

    To me it sounds like C is the new assembler. That language kicked my ass in college. I had to maintain some of it at my first job....in a word, NOT FUN. Then it was the road of Cobol, VB, and then I went into management. Understanding better now "C's" role though. Sounds like at a minimum it will be a nice foundation.

    Now my focus has changed, see pic

    Screen Shot 2022-02-08 at 10.24.00 AM (resized).pngScreen Shot 2022-02-08 at 10.24.00 AM (resized).png
    #22 2 years ago
    Quoted from iamabearsfan:

    I have a general question about "C". How much is it really used in the wild anymore? Everything I hear is he should be focussing on .NET languages like C#. Is that still true?
    He is a Computer Engineering major and they have the kids focussing on these lower level languages. Curious is the curriculum is current with the times.

    Most important skill is not a language or library, etc, but to be able to teach yourself as you need to constantly be learning/growing/evolving to survive. This is in terms of learning languages, libraries, platforms/services, algorithms, soft skills--everything. If you have this skill and are a talented, creative, driven person, there is a lot of money to be made as a programmer.

    Also, each language/platform has its pros and cons. You might use C/C++, Rust etc for high performance, realtime systems, OS, etc. But Python, C#, etc, might be a better choice for the backend of a website. Just depends on your requirements, skill set of your team, etc.

    If he wants to cut his teeth on something different from C, tell him to come up with a passion project single page web app w/ back end in AWS or Azure.

    For reference: I was a EE/CE but stuck with the pure software development side as I was a hobbyist and started coding when I was ~8 making stupid games, etc. Still loving it almost 16 years into my post collegiate career.

    #23 2 years ago

    I use C/C++ all the time when coding on microcontrollers.
    Python for scripting.
    I just learned x86 assembler for a prereq for a masters program.
    I code in whatever the situation calls for. I used to be a Perl junkie, but life moves on.

    #24 2 years ago

    Some of the best programmers I have ever worked with never even went to school. Programming is an art form and the people who are good at it are self motivated and like mentioned above, always learning. As long as your son has that inner fire to explore and learn on his "off" time he will succeed.

    #25 2 years ago
    Quoted from iamabearsfan:

    I have a general question about "C". How much is it really used in the wild anymore? Everything I hear is he should be focussing on .NET languages like C#. Is that still true?
    He is a Computer Engineering major and they have the kids focussing on these lower level languages. Curious is the curriculum is current with the times.

    My company doesn't care what you know, we hire junior developers based on personality, attitude, and problem solving ability. Development is easy to learn. Juniors get put on an agile team with seniors that help them during sprints and code reviews.

    In terms of high-dollar job opportunity, I would lean towards C#. The majority of our business is migrating older applications to .NET and Azure.

    In reality nothing you learn in college is important. Party a little, get the paper and move on. You still have to do the work yourself.

    I suggest going to local developer meetups and START NETWORKING. I hire 75% of our devs from meetups. Be ambitious, apply everywhere, get your foot in the door and work hard. If you can somehow get attached to government sector, that's a good way to boost your job security and dollar value.

    #26 2 years ago

    C on microcontrollers
    Python on Raspberry pi's
    C#, SQL and Angular everywhere else

    #27 2 years ago
    Quoted from iamabearsfan:

    I have a general question about "C". How much is it really used in the wild anymore? Everything I hear is he should be focussing on .NET languages like C#. Is that still true?

    C# is basically C which is basically C++.
    And yes; C, C++ is used everywhere. I know someone is going to say C# isn't C... but you can argue all you like... the syntax of the language is identical. The only difference is C# is a little newer with more layers; but the language syntax is the same.

    Quoted from radium:

    In reality nothing you learn in college is important. Party a little, get the paper and move on. You still have to do the work yourself.

    Ummm. k.
    Seems like I use my computer skills all the time. I use my programming logic learned in college every day. I use my electrical engineering skills learned in college... many times a week.
    So no; I disagree with you in every way.

    #28 2 years ago
    Quoted from iamabearsfan:

    Understanding better now "C's" role though. Sounds like at a minimum it will be a nice foundation.

    Exactly. C is a foundational language. If he gets that, he can migrate to whatever is needed from there as time moves on and his needs/goals become clearer.

    #29 2 years ago
    Quoted from Zitt:

    C# is basically C which is basically C++.
    And yes; C, C++ is used everywhere. I know someone is going to say C# isn't C... but you can argue all you like... the syntax of the language is identical. The only difference is C# is a little newer with more layers; but the language syntax is the same.

    <disclaimer>I have not programmed in C/C++ for a long time (about a decade now) so this information may be out of date.</disclaimer>

    The below is not commentary on the language constructs or language syntax.

    C is not object oriented. There is no implicit "this" object. That's one of the best features of C++. The ability to group instance variables - i.e. member variables. Instantiating an object allows multiple instances with their own context. You can, of course, achieve the same thing in C by passing a struct (pointer) around. C++ also implicitly supports polymorphism and inheritance. You can implement these in C but why bother when the C++ compiler does this natively in the language. The C++ compiler is also much more type safe. Standard C typecasting is inherently dangerous. C++ typecasting is much safer (with the exception of reinterpret_cast which is essentially a C typecast).

    C also does not have overloading. Another useful feature to make code more readable.

    C# also has one big fundamental difference from C/C++. It requires a supporting runtime (the CLR). C/C++ compiles to native instructions of the target platform and interfaces with facilities provided by the operating system. C# compiles to intermediate language (IL) and the runtime interfaces with facilities provided by the operating system. The IL is translated to native instructions by a JIT (just in time) compiler. I assume it is possible to produce a binary that is pre-compiled to native instructions but that binary still requires the runtime. The C# runtime also provides garbage collection and takes care of memory management. With C/C++ you are on your own. Leak memory (or address space) all you want.

    Gosh that brings back memories of years spent in a development environment and debuggers.

    #30 2 years ago

    <<to me it sounds like C is the new assembler. That language kicked my ass in college. I had to maintain some of it at my first job....in a word, NOT FUN. Then it was the road of Cobol, VB, and then I went into management.>>

    Assembler was the only class in college in '80 where I just said "I cannot stand doing this 'adding bits together' stuff and quit going to class. I could never see me being a systems programmer or something like that. Managed to talk the teacher into giving me a B I think. Then I mostly worked with Cobol for 30 yrs.

    #31 2 years ago
    Quoted from Zitt:

    So no; I disagree with you in every way.

    I almost wrote something very similar. Throughout my career, I've run into programmers who don't understand things like data structures, runtime analysis or even data normalization.

    #32 2 years ago
    Quoted from ThatOneDude:

    I almost wrote something very similar. Throughout my career, I've run into programmers who don't understand things like data structures, runtime analysis or even data normalization.

    There's nothing worse than a front end developer that claims to be full stack, but adds columns randomly to tables any time he needs them. No design, just the easiest wat to make the UI work. It always blows up later.

    #33 2 years ago
    Quoted from yaksplat:

    There's nothing worse than a front end developer that claims to be full stack, but adds columns randomly to tables any time he needs them. No design, just the easiest wat to make the UI work. It always blows up later.

    "Why is it that this algorithm works on my 5 element test data but gets nuked by the OOM killer when it's 50,000 elements?"
    "Why use a foreign key when I could just put the customer data right in that table?"
    Uggg. I have advocated for remedial data structures and algorithm classes in my current position. Some of the code that I see....damn....

    #34 2 years ago
    Quoted from ThatOneDude:

    I use C/C++ all the time when coding on microcontrollers.
    Python for scripting.
    I just learned x86 assembler for a prereq for a masters program.
    I code in whatever the situation calls for. I used to be a Perl junkie, but life moves on.

    Are you secretly me?

    But really, I just do devops now, and more in a management role than anything else. Pretty much all the coding I do now is the occasional .net script for spinning up an Azure resource or little c-ish scripts for tiny arduino projects around the house.

    #35 2 years ago
    Quoted from ThatOneDude:

    "Why is it that this algorithm works on my 5 element test data but gets nuked by the OOM killer when it's 50,000 elements?"
    "Why use a foreign key when I could just put the customer data right in that table?"
    Uggg. I have advocated for remedial data structures and algorithm classes in my current position. Some of the code that I see....damn....

    Foreign keys? Isn't all that just automatic?

    I'm bewildered by how hard sql is to these younger UI oriented devs.

    #36 2 years ago
    Quoted from yaksplat:

    There's nothing worse than a front end developer that claims to be full stack, but adds columns randomly to tables any time he needs them. No design, just the easiest wat to make the UI work. It always blows up later.

    You would be *horrified* at the state of "professional" Japanese console video game code. Literally every single one I've worked with from all the major companies in Japan is a mess. The only question is how large is the mess.

    #37 2 years ago
    Quoted from thekiyote:

    Are you secretly me?

    *Looks in the mirror and ponders this question*
    "Picked a bad day to quit taking mushrooms"

    I'm gonna lay some nerd shit on you now. When I was 9 years old or so, I picked up this fat book my dad had laying around. Hackers by Steven Levy. Yeah, at 9, I was a nerdy kid with a LOT of time on his hands. Anyway, the only machine available to me at the time was a TI-99/4a. No disk drive, so nothing but TI-BASIC for the language. I did my best, but it was really limiting. I did like the sprite characters that you could create.
    I longed for something I could really code on. I read about assembly, and wanted to dive into that. I eventually got into C in college, and that was like a breath of fresh air. It was a necessity, when I was taking classes like advanced operating systems, where we started on the first line of the boot code in Minix and worked our way through it. I made money as a Perl coder for years, until my eclectic background pushed me into devops. Eventually, the Arduino boards appeared, and I got back into C/C++. I took x86 assembly 2 years ago. I hated the platform(Vis. Studio on Windows), but loved the class. And it really made it clear how close C is to just being syntactical sugar on top of assembler. It was like learning ML back in the day. A rewrite of your view of languages.

    #38 2 years ago

    As others have said, the language used varies greatly by the situation.

    I have spent most of my life writing in C/C++, but I spent 20 years in the video game industry, and now about 15 years on military flight simulations.

    On the other hand, I have never written any sort of web-based application.

    #39 2 years ago

    Anyone need a C programming job? My team has several open at this time. Wish more C programmers were currently available.

    #40 2 years ago
    Quoted from ThatOneDude:

    *Looks in the mirror and ponders this question*
    "Picked a bad day to quit taking mushrooms"
    I'm gonna lay some nerd shit on you now. When I was 9 years old or so, I picked up this fat book my dad had laying around. Hackers by Steven Levy. Yeah, at 9, I was a nerdy kid with a LOT of time on his hands. Anyway, the only machine available to me at the time was a TI-99/4a. No disk drive, so nothing but TI-BASIC for the language. I did my best, but it was really limiting. I did like the sprite characters that you could create.
    I longed for something I could really code on. I read about assembly, and wanted to dive into that. I eventually got into C in college, and that was like a breath of fresh air. It was a necessity, when I was taking classes like advanced operating systems, where we started on the first line of the boot code in Minix and worked our way through it. I made money as a Perl coder for years, until my eclectic background pushed me into devops. Eventually, the Arduino boards appeared, and I got back into C/C++. I took x86 assembly 2 years ago. I hated the platform(Vis. Studio on Windows), but loved the class. And it really made it clear how close C is to just being syntactical sugar on top of assembler. It was like learning ML back in the day. A rewrite of your view of languages.

    Oh man, TI-Basic! That brings me back! I remember trying to learn ti assembly in high school, because that was what all the cool games were written in, but it would be years before I understood enough about how processors worked to know how to do that..

    My eclectic background was what got me into DevOps, too. I fell backwards into doing IT for schools and libraries, but I was moonlighting doing a startup. Eventually I moved onto DevOps because, by that point, I was a jack of all traits and it was a good job that allowed me to jump back to the private sector after the startup failed.

    If you told me you learned the basics of electronics building out of date phreaking schematics you found on the internet, that may be too much for me.

    #41 2 years ago
    Quoted from thekiyote:

    If you told me you learned the basics of electronics building out of date phreaking schematics you found on the internet, that may be too much for me.

    Alas, I learned it from first building a z80 machine, and having to figure out the basics using an arduino as a bios/ clock. Then, pinball electronics.
    I need to go back and finish that z80. I fleshed out a scheme for a multi-cpu computer along with passing and time slicing.

    #42 2 years ago
    Quoted from ThatOneDude:

    Eventually, the Arduino boards appeared, and I got back into C/C++

    I hadn't written in C/C++ in almost 20 years and just like you, here's the Arduino boards. VS Code is a whole lot better than having to use emacs. I just mess around with LEDs, messaging and triggering events, but it's a blast. I've got random thunderstorms running through my office.

    #43 2 years ago
    Quoted from yaksplat:

    VS Code is a whole lot better than having to use emacs.

    *gasp*
    Actually, I'm a vim user, myself, which some might consider even worse
    But I always thought it was absurd that I was using a tool that would occasionally bog down a laptop to build a binary that was less than 10k, even with a couple of libraries. I duplicated several of the assignments with gas. So much cleaner and quicker. Since you can't do x86 assembly on the OSX version of VS, I was stuck.
    Using an arduino as a BIOS let me skip a lot of the ugly parts of getting a z80 up and running. I also used one to make an EEPROM programmer. I used it to read and write ROMs for sys6 systems like Gorgar.

    #44 2 years ago
    Quoted from cataylox:

    Anyone need a C programming job? My team has several open at this time. Wish more C programmers were currently available.

    What's the going rate for a C job?

    #45 2 years ago
    Quoted from ThatOneDude:

    *gasp*
    Actually, I'm a vim user, myself, which some might consider even worse

    Heck, I'm a nano user. That's like remedial command line editor. But I'll be honest, I never needed more than that. If I wanted to do something beyond a small edit, I using a gui editor (I'm pretty much exclusively windows these days and use notepad++ for most of my stuff, coding and scripting).

    #46 2 years ago
    Quoted from thekiyote:

    Heck, I'm a nano user. That's like remedial command line editor. But I'll be honest, I never needed more than that. If I wanted to do something beyond a small edit, I using a gui editor (I'm pretty much exclusively windows these days and use notepad++ for most of my stuff, coding and scripting).

    My problem is that I've lived in Visual Studio, SSMS and Powershell ISE for 20 years, so not having intellisense throws me off. In my brain, if intellisense isn't working, something in the project is broken. So, working in VS Code maintains that logic. Developing in python in nano takes some extra brainpower for me.

    #47 2 years ago

    We use Visual Studio Code here. Modern IDEs are so much better at catching those dumb mistakes that could send you down a rathole of debugging. (Though I think there are still some vim / emacs diehards.)

    #48 2 years ago

    I'm a total hardware guy and found software so frustrating. I hated all the programming courses I took in college 25 years ago. Then I picked up an Arduino a few years ago and fell in love with it. I coded some cool measurement software using an analog front end that I built and put it on a display. I'm sure someone would look at my code and call it hacky, but it has comments and works. I even created some code to replace worn out mechanical steppers on my EM machines.

    #49 2 years ago
    Quoted from yaksplat:

    What's the going rate for a C job?

    I really don't know as I'm not a hiring manager. Last time I was hired was 26 years ago. I know entry pay has changed a bit since 1996.

    #50 2 years ago
    Quoted from Zitt:

    C# is basically C which is basically C++.
    And yes; C, C++ is used everywhere. I know someone is going to say C# isn't C... but you can argue all you like... the syntax of the language is identical. The only difference is C# is a little newer with more layers; but the language syntax is the same.

    Ummm. k.
    Seems like I use my computer skills all the time. I use my programming logic learned in college every day. I use my electrical engineering skills learned in college... many times a week.
    So no; I disagree with you in every way.

    .NET has interops (layers as you say) and in-class implementation and require a class object for the function call. C is global functions exclusively. .NET imports type libraries and dlls, C uses headers mostly and that can be complex. Managing memory in C is a skill, .NET does it for you.

    C++ data structures like the STL template library obsolete the need for C low level allocation of memory and pointer/iterator movement and needing to know where the /0 (null terminator) is. Do I need to mention C++'s CString? CString does allow for low level C type memory manipulation but for those less inclined, higher level encapsulated string manipulation as well.

    In summary, the higher level languages like .NET probably open the industry to different kinds of people that would not like C's low level architecture.

    Personally I got great satisfaction out of C programming at the beginning of my career and after awhile I liked just focusing more on C++ logic than C syntax. That said, I have a lot of respect for C programmers, it takes a lot more coding to do some things the higher level languages do for you.

    There are 68 posts in this topic. You are on page 1 of 2.

    Reply

    Wanna join the discussion? Please sign in to reply to this topic.

    Hey there! Welcome to Pinside!

    Donate to Pinside

    Great to see you're enjoying Pinside! Did you know Pinside is able to run without any 3rd-party banners or ads, thanks to the support from our visitors? Please consider a donation to Pinside and get anext to your username to show for it! Or better yet, subscribe to Pinside+!


    This page was printed from https://pinside.com/pinball/forum/topic/son-needs-help-w-c-programming-assignment-tutor-needed-fast?hl=skidave and we tried optimising it for printing. Some page elements may have been deliberately hidden.

    Scan the QR code on the left to jump to the URL this document was printed from.