15,551 Topics
| |
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 … | |
hey how to compare longest decimal number using == operator?? | |
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 … | |
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]); } | |
| 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 = … |
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 … | |
// 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); } | |
IS IT POSSIBLE TO PASS AN ARRAY INTO A FUNCTION AND THEN CALCULATE THE PRIME NUMBERS OUT OF THE LIST? | |
#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 … | |
#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 … | |
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 | |
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 … | |
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]); … | |
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 … | |
Can smb exaplin me how to instal sdl2.0 in codeblocks.. i tried different tutorial..they didn't help.. Ty a lot | |
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 … | |
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 … | |
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** … | |
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 … | |
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 | |
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 … | |
| 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 … |
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 … | |
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 … | |
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" … | |
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 … | |
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. … | |
I'm new to the gdb debugger and was wondering how to i step through my code in gdb. | |
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 … |
The End.