15,551 Topics

Member Avatar for
Member Avatar for ajanah.ibrahim

Write a function to remove all trailing blanks from the right end of a string. Assume the prototype is void trimRight(char a[]); Write a function to remove all leading blanks from the left end of a string. Assume the prototype is void trimLeft(char a[]); Write a function to add extra …

Member Avatar for Ancient Dragon
1
161
Member Avatar for Mehul Jain
Member Avatar for dharshudhanapal
Member Avatar for kavya_55
0
118
Member Avatar for np complete

I'm trying to emulate bash/cmd type program. I have written programs like cat, ls, grep (simple one) and kept it under \bin\ directory. This program will take user input and run programs present in \bin\ accordingly. I'm using `_spawnv ()` as the argument list is going to be variable. When …

Member Avatar for Ancient Dragon
0
194
Member Avatar for Mohammed_9

Is this correct? #include <stdio.h> #incluede <string.h> void getname(char name[][50],int num) int main() { void getname(char name[][50]) { for(int i=0;i<numofname;++) scanf("%[^\n]",name[i]); }

Member Avatar for 2teez
0
246
Member Avatar for Rahul47

Hello folks, This nitty problem is haunting me today. Here is the code I have written, but am not getting the expected output. This is a program for printing matrix in spiral order. #include<stdio.h> #include<stdlib.h> int main() { int rows,cols,i,j; int tr=0,rc,br,lc=0; /* tr = top row index. rc = …

Member Avatar for Rahul47
0
298
Member Avatar for john.kane.100483

Ok the admin said to me not to post in C++ if my problem is in C language. Ok here's my problem with my program now. #1 If I put this in a array what should I change? #2 In my looping I needed to press double enter to enter …

Member Avatar for David W
0
706
Member Avatar for ponedelnik

// Shortest function to convert an ascii hex digit to binary // (assumes a valid hex digit 0-9, A-F, a-f) char asciihex2bin(char ascii) { if (ascii > 0x40) ascii += 9; return (ascii & 0x0F); }

Member Avatar for ponedelnik
0
252
Member Avatar for ajanah.ibrahim

IS IT POSSIBLE TO PASS AN ARRAY INTO A FUNCTION AND THEN CALCULATE THE PRIME NUMBERS OUT OF THE LIST?

Member Avatar for David W
1
204
Member Avatar for joseph.suanino

#include<stdio.h> #include<math.h> #include<conio.h> #include<string.h> #include<stdlib.h> int main() { int i, n, diff; int x=rand() % 100; int bMoveHigher = 0; int bGuessedCorrectly = 0; printf("Welcome to Guess a Number Game\n"); for(i=1; i<=6; i++) { printf("ATTEMPT %d: Enter your number: ", i); scanf("%d", &n); if(n==x) { printf("Congrats! You have guessed the …

Member Avatar for David W
0
283
Member Avatar for joseph.suanino

#include <stdio.h> #include <math.h> #include <conio.h> #include <process.h> #include <string.h> void main() { int i, n, diff; int x = rand() % 100; int bMoveHigher = 0; int bGuessedCorrectly = 0; printf("Welcome to Guess a Word Program\n"); for (i = 1; i <= 5; i++) { printf("ATTEMPT %d: Enter the …

Member Avatar for Schol-R-LEA
0
223
Member Avatar for Emmaximum

Hello please i have a problem with my compiler. When ever i try compiling a program it gives me warning saying" Source code not compiled" I use Devc++ compiler. Do i change the compiler or what do i do? This is the program i typed in it

Member Avatar for Ancient Dragon
0
292
Member Avatar for ubhart

I am implementing Priority QUE as a doubly linked list. My structs: typedef int kintyr; typedef struct qElem { struct qElem *prv; kintyr *dat; int *priority; }qElem; typedef struct que { qElem *fr,*bk; int cnt; }que; And this is my functions to create empty PQ, and to insert elements: que …

Member Avatar for ubhart
0
398
Member Avatar for john.kane.100483

Hello :D I would like this to be explain. What is meaning of this following codes and why are they in there? I really don't understand. void Binary2Decimal() total=0 "%16s" len=strlen(bin2); value=bin2[i]-'0'; total=(total<<1|value); void Octal2Decimal() for(i=0;i<len;++i) value=buffer[i] - '0'; if (value < 0 && value > 7) void Hexa2Decimal() digit=toupper(buffer[i]); …

Member Avatar for john.kane.100483
0
143
Member Avatar for nitish.mohiputlall

The question: Modify the first Loop so that the values in the array data are initialized to multiples of 2 as follows: 2,4,6,....,20. here is the original codes that has been set in the question paper: #include <stdio.h> #define numitems 10 int main(int argc, char* argv[]) { int data[numitems]; int …

Member Avatar for David W
-1
138
Member Avatar for radu.nuconteaza

Can smb exaplin me how to instal sdl2.0 in codeblocks.. i tried different tutorial..they didn't help.. Ty a lot

0
47
Member Avatar for nitish.mohiputlall

here is the original codes that has been set in the question paper: #include <stdio.h> #define numitems 10 int main(int argc, char* argv[]) { int data[numitems]; int i; int *ptr; for(ptr = data; ptr < &data[numitems]; ptr++) *ptr = 0; for (i=0;i<numitems;i++) printf("data[%d]=%d\n", i, data[i]); return 0; } HERE ARE …

Member Avatar for 2teez
0
533
Member Avatar for nitish.mohiputlall

here is the original codes that has been set in the question paper: #include <stdio.h> #define numitems 10 int main(int argc, char* argv[]) { int data[numitems]; int i; int *ptr; for(ptr = data; ptr < &data[numitems]; ptr++) *ptr = 0; for (i=0;i<numitems;i++) printf("data[%d]=%d\n", i, data[i]); return 0; } HERE ARE …

0
89
Member Avatar for rabadiyaronak

i have two different programs that compare float and double variales and gives output , i shown that below : 1. #include<stdio.h> main() { int r; float f=22.5; double d=22.5; r=(f==d); printf("r=%d",r); } **Output:- r=1** 2. #include<stdio.h> main() { int r; float f=22.7; double d=22.7; r=(f==d); printf("r=%d",r); } **Output:- r=0** …

Member Avatar for jwenting
0
291
Member Avatar for joslup9

Hi guys, I am try to open a socket to connect a email account on C language, but i don't know how to use this protocol into a socket, in some links i found that i will need to use SSL protocol, but i don't understood. Any can explain how …

0
169
Member Avatar for glao

I am trying this: int test(int **a){ return **a; } int main(){ int p[2]={1,2}; int *a=&p[0]; int **d=&a[0]; //for (int i=0;i<2;i++) // printf("\na=%d\n",a[i]); //ok this works for (int i=0;i<2;i++) printf("\n%d \n",test(&a[i])); return 0; } I want this ` printf("\n%d \n",test(&a[i]));` to work. I want to use a pointer. Thanks

Member Avatar for Banfa
0
210
Member Avatar for shaneetra.graham

Trying to implement a history function in C, I know my array size for the history is 100 and i have a max of 9 arguments. I just wanted a little help or advice on where to start! I also know that i need my history initialized before i start …

Member Avatar for L7Sqr
0
2K
Member Avatar for MikeBah

I have been asked to build a group of functions that carry out set theory operations such as intersection and union. The functions below that I must complete are set_intersectWith, set_unionWith, set_minusWith, set_powerset, where: > set_intersectWith = A ∩ B > set_unionWith = A ∪ B > set_minusWith = complement …

Member Avatar for rubberman
0
560
Member Avatar for Aljaz

My programm wont let me input all the data I need. And when I try to display them it won't even use the data that I could input. Please help me and sorry for my bad English it is not my native language, that's why all the data is in …

Member Avatar for Aljaz
0
226
Member Avatar for nitish.mohiputlall

i have to add two matrices and i am having this error: "error array subscript is not an integer" line 24 here are my codes: #include <stdio.h> void inputarray(int arg[][3], int rows); void printarray (int arg[][3], int rows); void inputarray2(int arg[][3], int rows); void printarray2(int arg[][3], int rows); int main …

Member Avatar for Schol-R-LEA
0
2K
Member Avatar for swaar.metaal.7

Hi everyone, Hope you are all doing very well. I have run into a new problem with this project I am working on... Currently, I get data in the following format across my UART communication: g_Uart1RxData[0] = "1" g_Uart1RxData[1] = "2" g_Uart1RxData[2] = "3" g_Uart1RxData[3] = "4" g_Uart1RxData[4] = "5" …

Member Avatar for swaar.metaal.7
0
99
Member Avatar for john.kane.100483

Hi everyone my Binary2Decimal is okay now because it can now hold 16 digits. But how come my Octal2Decimal and Hexa2Decimal can't hold 16 digits to convert to decimal it can only up to 5 digits. Can anyone correct this problem? #include<conio.h> #include<stdio.h> #include<string.h> #include<ctype.h> char base; char key; void …

Member Avatar for David W
0
180
Member Avatar for overwraith

So I am working on an old project that uses libnet, actually it is a book example, and I cannot find a version 1.1 or 1.0 of libnet. I am going to somehow have to track the depreciation of certain functions and I have never done something like this before. …

Member Avatar for L7Sqr
0
110
Member Avatar for shaneetra.graham

I'm new to the gdb debugger and was wondering how to i step through my code in gdb.

Member Avatar for Ancient Dragon
0
78
Member Avatar for cppgangster

Hi there, I am having a problem of passing arrays to functions, here is my code: void zeroMatrix(float **arr); void main() { float e[2][2]; zeroMatrix(e); } void zeroMatrix(float** arr) { int i,j; for (i=0;i<2;i++) { for(j=0;j<2;j++) { *( *(arr +i)+j) =0; } } } The problem is I want to …

Member Avatar for David W
0
339

The End.