Quantcast
Channel: C - Codecademy Forums
Browsing all 25 articles
Browse latest 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
Browsing all 25 articles
Browse latest View live




Latest Images