Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
113 views

I'm currently working through Bjarne Stroustrup's Programming: Principles and Practice Using C++ (3rd Edition). The book mentions a function named round_to() is provided in PPP_support.h When, on the ...
Khavin S's user avatar
3 votes
3 answers
173 views

recently just practiced the problem 67 in Leetcode This problem is like you would be given two binary string, and you have to calculate the sum of these two binary string and return the result.For ...
Onion_in_1945's user avatar
-5 votes
3 answers
124 views

I'm still new at functions and I tend to print the function which I don't know how to print the declared function. It prints "1" and not "John". #include <iostream> void ...
NAYbabal's user avatar
3 votes
4 answers
190 views

I'm trying to make a program that deletes extra white spaces from a string. It should keep one space but delete any extra. I wrote this code, which works up until the point I have to change the passed ...
user1497350's user avatar
1 vote
2 answers
66 views

Hi i'm trying to write a recursive function to extract each line of a string. I don't know why it doesn't work i spent 2 hours trying to find the issue. #include <string.h> #include <stdlib.h&...
Yuki's user avatar
  • 93
4 votes
6 answers
276 views

So my professor gave us the assignment to code a function that works exactly like strcmp() but without using any library functions. I came up with the following code but instead of returning 1 or -1 ...
Nebelmonster's user avatar
0 votes
5 answers
107 views

Below is my C code for LeetCode no. 707 "Design Linked List": typedef struct MyLinkedList{ int val; struct MyLinkedList *next; } MyLinkedList, *LinkList; MyLinkedList* ...
Clay_Han's user avatar
0 votes
2 answers
98 views

//my_struct.h typedef struct my_struct_t *my_handle; void f1(my_handle handle); void f2(my_handle handle); //my_struct.c #include "my_struct.h" typedef struct { int a; int b; } ...
Parminder Singh's user avatar
0 votes
2 answers
95 views

I would like to use values within variables for defining functions in R. However, after declaring the function I can still see the variable names instead of their values inside the function definition....
Imsa's user avatar
  • 199
4 votes
2 answers
147 views

There are (source): void f(); // declaration (1) void f(void); // declaration with prototype (2) void f() { ... } // definition (3) void f(void) { ... } // definition with ...
Sinatr's user avatar
  • 22.3k
3 votes
0 answers
65 views

What are the differences between the three syntaxes funName l = map fun l funName = \ l -> map fun l funName = map fun In general it does the same thing however in some cases it differs. The ...
Clément Morelle's user avatar
2 votes
3 answers
179 views

I have written a code on deleting a node by comparing its data from the data given. If equal, it deletes the node. My problem is that my code will delete every node in the list except the last node, I ...
user avatar
-3 votes
3 answers
155 views

We know that definition of pre defined functions are in library files, and it is the job of linker to link that library code(which is already compiled) to our object file (which has been created after ...
Harsh Chaudhary's user avatar
2 votes
1 answer
72 views

I am practicing recursion function in C. The question is to create a recursive function to print a sum of all of the elements (int) in an array without changing the main function. I know how to write ...
tnwl.suzy's user avatar
0 votes
1 answer
58 views

I have a templated class foo<T> which is specialized in many different ways. Some of which have a lot of common code that relies on specialized functions. For example, consider the following: #...
Mickey's user avatar
  • 37
1 vote
2 answers
246 views

I am writing my own strtok function. How do I make it so that it will return the remaining string as an output parameter? Here is what I made so far. char *mystringtokenize(char **string, char ...
sangregoriokimpo's user avatar
0 votes
2 answers
210 views

I am having a problem with this code on Leetcode. In there , I am solving a problem to remove duplicates in an array but I am getting heap buffer overflow error - Here's the code - int ...
Harshit Kumar's user avatar
2 votes
1 answer
98 views

My Programming I class assigned an exercise in which we have to implement a function that counts the number of occurrences of a non-consecutive subsequence in a string. This is what we're asked to do: ...
serialexperimentshaku's user avatar
1 vote
3 answers
91 views

Consider I'm still a newbie with C, so I made a lot of confusion. This code works fine int error(int a, int b, int c) { if (( a < 0 ) || (a > 255)) { printf("Number is over 255 or ...
elbarna's user avatar
  • 835
0 votes
3 answers
62 views

i tried to make a game using 2d character arrays. but the if else statements are not working and the loop is not breaking. Also when i assign a character to the last element of my row , the next row's ...
Mayank's user avatar
  • 9
1 vote
2 answers
303 views

I was programming a code for a case provided by my university. It was about making a Fibonacci function, but for letters. For example, if f(0) -> a, f(1) -> b, then f(2) -> ba, and so on. I ...
ruwby's user avatar
  • 29
0 votes
2 answers
1k views

I am trying to use robotframework with vscode and installed robotframework language server , i am not able to jump to function definition . expected response :- should jump to function definition when ...
VIADISHWAR SHARMA's user avatar
1 vote
1 answer
88 views

I am needing to make a program to take user input of iterations to the formula : PI=4(1/1 -(1/3)+(1/5) ... repeating a number of times. MY problems so far is that it is not taking my input accurately. ...
Spongebuild's user avatar
0 votes
2 answers
191 views

I am currently using exercism, to improve my programming skills. The code works fine in my IDE, but causes an error message on the website. What did I do wrong and how would you improve my code? Thx ...
BenG's user avatar
  • 1
2 votes
0 answers
65 views

This issue occurs when trying to split the template into declaration and definition for ease of reading. Consider this MWE #include <type_traits> template <typename T1, typename T2, int N = ...
oarfish's user avatar
  • 4,774
1 vote
3 answers
81 views

#include <stdio.h> #include <string.h> void pigLatinConsonant(char input[]) { char end[] = "ay"; int length = strlen(input); int first_vowel = -1; for (int i ...
Tanya Kumari's user avatar
-6 votes
1 answer
759 views

I'm trying to build my strstr() function, it's look all fine but when I execute the code it return nothing ; This is my function : #include <stdio.h> char* ft_strstr(char *str, char *to_find) { ...
Omar Ghazi's user avatar
1 vote
1 answer
113 views

I've coded a program based on an array of structure and all parts of it are ok but one of my functions that is sort_student function has a bug. In this code at first the user will enter some students ...
user avatar
0 votes
3 answers
103 views

The following program use an interger stack. Which value the function int pop() can return when the stack is empty, if I want to avoid using isEmpty() before calling the pop() ? #include <stdio.h&...
user2805902's user avatar
-5 votes
1 answer
77 views

Θ or Θ(f(n)) is often defined in terms of O(f(n)) or Ω(f(n)). Other answers on this site define Θ(f(n)) in this way. What is the definition of Θ(f(n)) without using O or Ω? Of course, since it is true ...
BigMistake's user avatar
-1 votes
2 answers
326 views

So this code is obviously incomplete and messed up but when I try to format my code I get an error here which I wasn't expecting (on the bracket after int getNumberFromSingleLine(char * singleLine) ...
user21380365's user avatar
0 votes
2 answers
214 views

I'm getting the following error when trying to build and run my C++ Project: ||=== Build: Debug in CS II (compiler: GNU GCC Compiler) ===| obj\Debug\main.o||In function 'main':| |30|undefined ...
Frasher Gray's user avatar
3 votes
3 answers
126 views

I'm stating to write some leetspeak code in C, however, I keep getting error like: error: incompatible integer to pointer conversion returning 'char' from a function with result type 'string' (aka '...
dbeltranor's user avatar
-2 votes
2 answers
113 views

Read elements from keyboard until a negative value! Insert those elements into an array such that the array is always sorted. I added the code and its outcome. I have a zero on the first position ...
ProfessorEmanuel's user avatar
1 vote
0 answers
26 views

I want to define a function inside a loop using and changing variables which have been defined within the same loop iteration. I would expect that nonlocal is just what i need here, but if i implement ...
Andrej Tzutzu's user avatar
2 votes
3 answers
485 views

I have a question that I am stuck with for a couple of days, and I need some help. I have a function called splitList. The function needs to remove nodes from the original list and move them to a new ...
ezra's user avatar
  • 103
2 votes
2 answers
181 views

I have a strange error concerning the inline keyword, this is just a sample code I wrote: #include <stdio.h> #include <stdint.h> uint8_t inline LIB_MATH_BTT_u8GetMSBSetBitPos(uint32_t ...
abdo Salm's user avatar
  • 1,923
1 vote
1 answer
1k views

I need to return a list with all values of an Enum (specified as parameter or generic). If the user has a specific role I need only some of the Enum values given as parameter. I considered to write ...
Mihai Socaciu's user avatar
0 votes
3 answers
697 views

First of all, I'm not sure if the title describes well the problem, feel free to change or suggest a more fitting heading. I have the following problem: I need to pass a function pointer to some ...
Sespaetzlean's user avatar
0 votes
1 answer
69 views

y = 0 x = 10 print("TRUE" if y>x else theloop()) def theloop(): while y < 11: print(f"Number is {y}!") y = y + 1 I want y to keep on getting bigger by 1 until it ...
marc77's user avatar
  • 17
2 votes
1 answer
166 views

1561/1563 test cases passed problem discription: You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes ...
Jovan Dejanović's user avatar
0 votes
1 answer
123 views

Given a string T and a pattern P which is also a string. Find the number of occurrences of P in T. Input Line 1: contains string P (length is less than or equals to 10^5) Line 2: contains the string T ...
fknoob's user avatar
  • 19
1 vote
1 answer
62 views

this function intersects the first list with the second, and it has to return a new list, I've used elemtype.h and list.h, (of course with elemtype.c and list.c) this is elemtype.c: #define ...
Gabriel Burzacchini's user avatar
0 votes
2 answers
93 views

The program is a Tic-Tac-Toe game, and it hangs after taking the X and Y values from the user. This is the main file: #include <stdio.h> #include <string.h> #include "input.cpp" ...
ProgrammingSolver's user avatar
-3 votes
3 answers
149 views

#include <stdio.h> char *cap_string(char *str); int main(void) { char str[] = "Expect the best. Prepare for the worst. Capitalize on what comes.\nhello world! hello-world 0123456hello ...
Katiana_de_Almeida's user avatar
2 votes
1 answer
943 views

On trying to recreate "memset" function I have error if I try to dereference a void pointer, or have a different type for the second argument than the first. To make the function work I had ...
Sofía Huppertz's user avatar
1 vote
2 answers
543 views

I have a bunch of bitsets<32> as global variables in my program and I want to update them after passing a pointer to one of them to a function. Here is an example: #include<bits/stdc++.h> ...
Hadj Ahmed's user avatar
0 votes
1 answer
64 views

Why does putting reverse() inside main() print 12345 while putting reverse() as the last statement of itoa() definition produces 54321? #include <stdio.h> #include <string.h> void itoa(...
materia-nigra's user avatar
0 votes
2 answers
44 views

Written a program to find the multiplication of two polynomials using linked list. Checked for all the possible segementation faults finding no errors (checked the multiplication function). #include&...
Hammish Raj Wadeyar's user avatar
-1 votes
1 answer
82 views

enter code herei was watching a video in data structures in C , and when i understand the abstract view of the concept i go try implementing it without watching the implementation in the video , and ...
Az_T's user avatar
  • 9

1
2 3 4 5
20