Quantcast
Channel: C - Codecademy Forums
Browsing latest articles
Browse All 25 View Live

C Programming - String Copier

Hi guys, I can’t get my head round this program. I’ve spent hours trying get it up and running an I’m still getting errors. Can anyone point in the right direction. #include<stdio.h>...

View Article



Image may be NSFW.
Clik here to view.

Incrementation of pointer within a function

Hello, the code below functions properly, the output is 23. And yet I’m confused why it doesn’t output the same result (the output stays 22) when I increment the Pointer by writing *agePointer++;...

View Article

Loops: Lesson - Continuing in C

Hello, In the lesson: https://www.codecademy.com/courses/learn-c/lessons/loops-c/exercises/continuing The first part of the exercise says to: Use continue to make the while loop skip the print...

View Article

Anagram Finder | C

Unsure how to correct my code here, regardless of what I input it always reads an anagram. #include<stdio.h> #include<string.h> int main() { int flag = 0; int counter1 = {0, 0, 0, 0}; int...

View Article

Race simulator in c only printing first letter of name and color

#include <stdio.h> #include <stdlib.h> #include <time.h> // Structures section struct Race{ int numberOfLaps; int currentLap; char firstPlaceDriverName[20]; char...

View Article


How to do this program?

I am writing a program that has 3 numbers stored, it has to output the nos. in ascending order. 4 posts - 2 participants Read full topic

View Article

Mini calendar solve

umm, this is my code, after remake cause the last one didnt work (i dont know why :)) ), hope it can help u <3 i write code in VS so it need #define _CRT_SECURE_NO_WARNINGS to use scanf. #define...

View Article

Nested tenary operation in Fizz Buzz

Hi there, When I try the fizz buzz exercise, I think up with an interesting solution that I didn’t know why it works. The codes are compact but it really works. #include <stdio.h> void...

View Article


String copier project help

I am trying to write the code for the “String Copier” project (link to the project ) that comes with the C lesson on pointers. I don’t understand what’s wrong with my code. It outputs a bunch of error...

View Article


Image may be NSFW.
Clik here to view.

Inverted linked list In C

Hello friends ! , in my following code in C I want to invert my linked list in the display using a 𝗿𝗲𝗰𝘂𝗿𝘀𝗶𝘃𝗲 𝗳u𝗻𝗰𝘁𝗶𝗼𝗻 ; but the code does not work !! Is there an error; thank you for mentioning it...

View Article

I just can't understand the array and how it works in C?

It’s been quite a few days now and I just can’t understand what the array is all about in C. I watched many videos and even read some articles but all that I was able to understand that array is bits...

View Article

Grocery Store Part 1

I have been trying to troubleshoot, but I can’t figure out why my compiler is printing out: “An apple costs: $1.49, there are 23 in inventory found in section: F and your customers gave it an average...

View Article

All "for" loops can be a "while" but not all "while" loops can be a "for"?

The C programming language is everywhere, and learning it will help you become a better programmer ready for the next challenge in any field of computer science! Hi I was doing the following quiz...

View Article


Please Help me. Nothing being Printed probably Pointer mistake

So I was programming C in one of the lessons and nothing is being printed to the console. Please help. Here is my code. No errors are coming up! #include<stdio.h> #include<string.h> void...

View Article

Error in the Mini-Calender project in C

I have almost just started the project and am getting an error with the following code. The programme is finding out whether or not it is a leap year. The condition in summary is this; A leap year has...

View Article


So my bubblesort doesn't like me

Hello, I tried writing a bubble sort algorithm but there is always a runtime error. I can’t find the logical error I would be happy if someone found it. everything except 20 is printed instead of 20 a...

View Article

Race simulator help: not printing name or color

As said in the title, the driver’s name and car color are left blank when I run the code. #include <stdio.h> #include <stdlib.h> #include <time.h> // Structures section struct Race {...

View Article


Race car simulator help: using sleep()

Hi there ! My name is Marc, I am new to codding and C is my very first language. I am following the Learn C course. I have to admit I struggled a bit getting to the last project and had to use chatGPT...

View Article

Image may be NSFW.
Clik here to view.

Learn C: Variables and Operators. VARIABLES: LESSON Casting Types Continued

https://www.codecademy.com/courses/learn-c-variables-and-operators/lessons/variables-c/exercises/casting-types-continued //I have a silly question :) //I understand this line: targetChar =...

View Article

Image may be NSFW.
Clik here to view.

While Loop in C

I have a few questions regarding this code. I have tried all these scenarios, and not sure how or why the code is behaving in certain ways. Q1. Lines 5-6. Given both the ‘guess’ and ‘tries’ variables...

View Article

Trouble with Mini Calendar Project

Hello there, I’m having a bit of an issue with my code. It runs smoothly, but for some reason adds an extra 2 days more than necessary. I tried calculating 8th of April and instead of the 3rd of June...

View Article


Image may be NSFW.
Clik here to view.

Question regarding the Race Car project

Hey guys, I have an up and running programme, so that’s all right. I was just wondering, at task 2, in the hint it says we can declare our string member variables with char*, but I couldn’t figure out...

View Article


Mini Calendar not producing any output

Hello! I am on the “Mini Calendar” challenge in the C skill path. It seems all fine, I get the code running, there are no compile errors. But when I enter the date and days to add, nothing appears....

View Article

Switch goes straight to default

Hi there! Hoping someone can take a glance at this and let me know why my second switch statement goes directly to the default instead of catching the suffix that correlates to the date. #include...

View Article

Body Mass Index(BMI) Calculator: Why is my program not working as expected?

Hello! I’ve been trying to program a Body Mass Index(BMI) calculator. In case you don’t know what BMI is, its basically the weight of a person in kilograms divided by height in meters squared. When I...

View Article

Browsing latest articles
Browse All 25 View Live




Latest Images