Hello, Thank yo for your answer.
I don't really understand the sorting algorithm
Why do we return true and why do we return false?
Type: Posts; User: Obvious Guy
Hello, Thank yo for your answer.
I don't really understand the sorting algorithm
Why do we return true and why do we return false?
I am pretty new to c++ and I am trying to implement an efficient sorting algorithm. I want this to also work for four players but at the moment I am testing my program for 2 players. Each player has...
I wrote a code that requests user input and then converts binary to bcd then back to binary using bitwise operations.
While I think my code is good I want to know if there is a better way to write...
hello
Thank you for the answer
I have one question
How can I modify this code that it will count it as an error if the same wrong letter is inputed more than once?
Thank you for your answer. And I realized that I would probably have to start from scratch.
But the problem I haven't been able to solve is the output.
For example if the word that is Entered looks...
I am almost done with the code , it's just that I can't figure it out. I have been trying for hours and I would be really happy if someone could help me
I wrote a very simple Hangman game that requests user input then makes the user guess up to six times.
The first letter of the word is always shown and if the user inputs the same letter that has...
what would you change about my approach?
buffer[i] should have the first string in the file if i = 0
or is it pointing to the first character instead of the first string?
Thanks for the reply.
I don't quite understand what you mean when you said I should be calling strcspn separately
Where should I call it?
I changed the strspn to
if...
I wrote a code that reads a txt file line by line and checks if each line has the invalid character ' ' in it.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define NCHAR 64
...
I am almost there
I wrote a function.
But now it does removes the space from the first array element.
#include <stdio.h>
#include <string.h>
but I don't think hat would solve my stack smashing problem
I am working on a project that reads input from a file ,stores them into an array and remove the spaces in each string array.
I am doing this so that I can check if the string that were read in the...
I wrote a code that takes input from a file and stores them into a linked list.
My code stores the contents of the file into a node contains a char array.
So if I did everything right each name in...
For an assignment I have to create a linked list.
I have to read from an input file and save the contents to a linked list.
But before that I want to ask for advice which approach would be wiser....
yeah that's what I am trying to do. shifting as in caesar cipher
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char array[20];
int length = 0;
int i;
int key = 256;
while using fgets to get the input from the user I am trying to reduce the string length of the array by one when a space is read.
this is a small portion of the code.
...
I wrote this code that asks the user to input the number of triangles and triplets.
however when i print out the array elements I get a seg fault.
During the first iteration that the user is...
I dont know thats what i am trying to solve
for example if the input is 0, 1,2 or 3
the output should be "zero", "one" "t
wo" or "three".
for all other numbers the output should remain the same. so if the input is 22 the ouput should be...
no I tried it
I added a putchar('\n') in the while loop and in the for loops
I still didn't get the result I wanted.
for example it converts 11 to oneone. It should only work for int from zero...
in the loop?
that won't help i believe
I wrote code that replaces integers from 0 to 3 with strings. I was only allowed to use getchar() and putchar(). If the input is 1, the output will become "one".
And I am only allowed to use...