15,551 Topics
| |
Hello, I have a function that looks like this: [code=C] CMyMessage(char type, char *name, char namelen, char *text, char textlen){ ... ?! } ... void main() { char name[50]="JOHN"; char text[200]="testing123"; CMyMessage(1, name, strlen(name), text, strlen(text)); } [/code] The ranges are: Type = 0/1; namelen = 0..50; textlen = 0..200 … | |
I am Zeeshan from Pakistan. now living in KSA. I need help regarding to chose computer programming language to learn online without going to any institute as i do not have any time here to go any where, and also i think that i have to become a comp programmer … | |
i have just giving a command textcolor(5+BLINK); cprintf("abc"); it will blink and print abc. but now after this i want to input a string and the problem is the input string also blinking which i dont want. how do i solve this???? | |
Hello, My program looks something like this: [code=C] char *name= (char *)malloc(200); unsigned char type=1; unsigned char GetType(){ return type; } char* GetName(){ return name; }; void function(unsigned char* message, int* intPtr){ message[0]= GetType(); // works correctly // CODE HERE } void main(){ unsigned char *message= (unsigned char *) malloc(256); … | |
Dear members... I'm looking for a code in C language to calculate the sum of two number in Hexadecimal base.But I don't wanna use Math library.Please help me to do it as soon as possible... Respectfully... | |
hi, is there any code that calculates the cdf of lognormal distribution? i came across one in codecogs.com but it requires commercial license:/ any help would mean a lot. thanks from advance | |
globals.h [CODE] #ifndef _globals #define _globals #define NEXT(L) ( (L) -> next ) #define DATA(T) ( (T) -> datapointer ) #define LEFT(T) ( (T) -> left ) #define RIGHT(T) ( (T) -> right ) typedef enum { OK, ERROR } status ; typedef enum { FALSE=0 , TRUE=1 } bool … | |
hey guys! how do i calculate the sum of a column in .csv file format using C? e.g my fie looks like this 1, 2, 3, 4 2, 3, 4, 5 3, 4, 5, 6 (the ',' shows new cell) how do i calculate sum of each column (desired answer … | |
Hi, I'm beginning with C and makefiles. I'm trying to compile a list of C files with GNU Make. My code should compile all the C files in the folder into .o files along with few flags and then use these .o files to compile an executable file 'main'. and … | |
Can someone show me a sample code in c which can read in a user inputted sentence/line and then split that line down by white spaces into separate words please? I shall worship you as my new God if someone out there can just show me a sample solution. | |
I'm writing a pure C game engine. I assert every pointer returned by malloc() in my code. Now I'm writing a function that will "slice" a loaded texture into new textures (parts of the parent texture). The parent texture is loaded correctly (other textures loaded by the same loader were … | |
How do you initialize a dynamic structure that has a const data member? I can provide an ugly hack but I'm at a loss as how to do it correctly. Actually, can you do this in a platform independent way? [code] #include <stdio.h> #include <stdlib.h> struct mys { const int … | |
I've built successfully my server & client program in C, able to establish the connection and message can be sent from both side client <-> server. Pls help me to deploy for:- (1) How to transfer file? (2) If i enter command e.g. - "pwd" in client side, current directory … | |
Hi guys, I've got a question that hopefully someone can answer. I have a file that contains the following structure: g hub f 100 200 300 12 f 356 403 345 484 f 333 212 1203 393 g door glass f 323 9292 383 f 32 3838 3939 f 1231 … | |
My original plan was to pipe "ls -l", get the permission string that represented the file in question. Translate the string of 'r's 'w's 'x's '-'s into 0s and 1s then convert it from binary to octal. This seems really cumbersome and annoying and I gotta figure there is some … | |
Hi! I’m trying to write a ‘C’ program to extract variable definitions and variable use in each line from a input ‘C’ program. That is, a variable is said to be defined when its value changes(including declarations) and it is said to be ‘used’ when it is referenced. I need … | |
I have made floyd warshall algorithm. I need some help for finding shortest path from source to destination. We have to give source and destination. Eg. Program gives us output like source=A and destination=D then shortest path is A-B-D with distance 10. I also give the code for that in … | |
[CODE]#include<stdio.h> #include<conio.h> main() { typedef enum y; int c; y colour {RED,WHITE,BLUE,BLACK}; clrscr(); printf("The assigned value is %d\n",RED); printf("The assigned value is %d\n",BLUE); printf("The assigned value is %d\n",BLACK); c=RED+BLACK; printf("RED+BLACK IS %d",c); getch(); }[/CODE] What is wrong with this code please? | |
[CODE] void printTable(char (*tacToe)[3], int row, int col){ } void initTable(char (*tacToe)[3], int row, int col){ } int main(void){ char tacToe[3][3]; initTable(tacToe, 3, 3); printTable(tacToe, 3, 3); } [/CODE] here is my question. what is the difference between *ary[] and (*ary)[]? when i did the program initially like so: [CODE] … | |
Hey guys, I have a really quick and hopefully easy question for you all. I'm trying to read in and store some floating point numbers from a file into an array. The lines look like: [B]boom.txt:[/B] [CODE] v 0.000034 0.44556 0.34444 v 4.000 1.0 1.0 v 4.00056 1.2003030 4.000 [/CODE] … | |
Hi everybody! Now I'm dealing with binary file handling and I need to read 70 bits into a variable from a file. As far as I know (correct me please, if I'm wrong), C does not have any variable type that could hold such large data. (I think) I cannot … | |
Hi friends, well... i'm asking for another help from you guys.hope you will... My friend sent me a email asking why the following code doesn't work properly.I'm also couldn't understand what's happening..When this program run it supposed to prompt two times to enter values.but its actually prompt once. I tried … | |
i am trying to write a split function ...which will accept a array and split it down to diffrent strings on the basis of '-' symbol can u tell me where i am wrong i am getting segmentation fault ...i think it is due to the pointer array i used … | |
Hi all, I wrote a program that has many functionalities but I can not swap 2 elements of 2 nodes in the linked list.Actually I can swap 2 nodes by changing their links but I can not swap 2 elements when the user requested 2 elements swapping.Here is my code … | |
I was trying to input an array of strings using pointers but failed. Here is the code: [CODE=C]int i=0; char *p[6]; //array of strings for(i=0;i<5;i++) { gets(p[i]); // input string } for (i=0;p[i];i++){ printf(p[i]); // print string printf("\n"); }[/CODE] The problem is that each time the first for loop executes, … | |
Please help me to write c program in order to calculate value as below: 1 + 3 + 4 + 6 + 7 + 9 + 10 + ... My Email: [snipped] [CODE][/CODE] | |
I'm trying to make a deck of cards to use in a blackjack game but I'm having problems. [CODE]#include <stdio.h> #include <math.h> #include <string.h> main(){ int i; typedef struct { int rank, suit; } cardtype; cardtype deck[52]; cardtype hand[5]; char *rank[13] = {"ace", "Duece", "3", "4", "5", "6", "7", "8", … | |
i am trying to write a simple webserver which serves 1 htnl file but i dont know where i am going wrong i am not able to read the file any suggestions ? [CODE] listen(sockfd,5); clilen = sizeof(cli_addr); newsockfd = accept(sockfd,(struct sockaddr *) &cli_addr, &clilen); if(newsockfd < 0) error("eror on … | |
Hey, So I've got these instructions for a piece of work, but I don't understand what it's saying, there are prototypes for functions but like I said, I don't understand them. [CODE]typedef struct BigInteger* big_integer_t; // so I know typedef allows you to assign different names to existing types, but … |
The End.