15,552 Topics
| |
I am trying to implement my own atoi function, and I am supposed to pass my variables in after ./a.out. Here is my code: #include <stdio.h> #include <stdlib.h> int myatoi(char array[]) { int sum = 0; int i = 0; while(array[i] != '\0') { int number = array[i] - '0'; … | |
Hello guys....I just have some doubt about C programming...well I have done a lot of functions for airline booking system but im not able to implement the multi dimensional array... I dont get how should I implement it in this problem as the variables are global and they are used … | |
How to produce an assembly file (.asm) on Windows by having a program in C? I use NetBeans 6.7.1 on Windows and it would help me a lot if i could do that, additionaly do you know a way that the syntax produced will be compatible with MASM? I have … | |
| what's wrong here? [code=c] typedef struct person { int age; char name[50]; }; int main() { struct person test; test.age = 20; test.name = "Test"; return 0; } [/code] |
Hi everyone. I'm diving head first into the fascinating world of Linux network programming. I've read about using sockets to do the networking, however, all the books I've seen so far have talked about IP addresses. My goal is to connect my PC to a development board and make them … | |
This is the problem: In this exercise you have to write a program to manage items in a super market. Suppose that the data about each item includes: • Item’s ID: ID of the item, it is an integer which ranges from 1 to 9999 • Item’s type: Its value … | |
Hello guys, How can I make a switch case using an array of chars. Ex: [CODE]char input[50]; // my code here switch ( input ) { case "abc": // do something break; case "xyz": // do otherthings break; }[/CODE] Is that possible in C? Thank you! | |
Hi! I wrote a program that reads and saves e-mails, of course by using sockets for connecting to the mail server. But I don't know how to download attachments, I used telnet to open an e-mail with an attachment, and I didn't see a link or something to the attached … | |
Hi All, I have the application which will be support 32 bits and 64 bits and below are the statement to handle 32bits/64bits data and new_node->data is void * new_node->data for ( index = 0 ; index < items ;index++ ) { if (data_size == SIZE_32 ) { * ( … | |
Hello I'm doing a program about UART in Borland C. And I have a few questions. This is the code: [code] #include <iostream.h> #include <dos.h> #include <conio.h> #include <stdio.h> #define COM1 0x3F8 int main(void) { clrscr(); // outportb( COM1 + 1, 0 ); outportb( COM1 + 3, 0x83); outportb( COM1, … | |
How to support Pthread calls like(pthread_create) in Vxworks 5.5 We have include the macro INCLUDE_POSIX_PTHREAD but we are getting linker error while loading. We tried to build the bsp(In tornado 2.2) with the pthread after changing the config file but we were not able to build the bsp | |
Hello , i have written the code for finding the middle element of the list with 0(n) complexity. please gurus, verify that and let me know if it needs any modifications and ofcourse i have question to ask when the no of elements are odd we can easily find the … | |
Hello, I need a pointer on how exactly I can use part of the terminal for inpit and another part for output. Example [code]Enter the next command> [my command] <other thread display some stuff>[/code] Because I have a thread to display and a thread to read and I don't want … | |
I'm currently working with a group of my classmates on a recipe measurement converter, and I'm currently on the most difficult code of the three that is my part of the project. The code is basically for getting the amount from the user, a fraction. I have based my algorithm … | |
I need to print out the following values on std-out: -CPU Type and Model -Kernel Version -Amount of time since the system was last booted, in the form dd:hh:mm:ss This is all on Ubuntu 8.04 I have looked through my Linux Kernel book but it is very vague about how … | |
written a code for finding nth last element but no idea how to caluculate complexity. how can i make this, of 0(n) complexity. [CODE]// p is position of element to find int nthlast(struct node *n, int p) { struct node *f, *s; if(n) { int cnt=0; f = n;// start … | |
I am attempting to write a simple chess program (starting with just pawns), and am currently at the stage of initialising the board. The initial board is declared using an array of numbers, with '0' indicating a white piece, '1' indicating a black piece and '2' indicating an empty square. … | |
I really need help to convert decimal number to equivalent ASCII. I store decimal value in x. for example int x = 255; and I want to display it also as '255' in HyperTerminal. Hope someone can help me :) | |
hello, i'm making program which repeatedly (through while) gets input from the user ... program should stop whenever user enters "\n" (or enter button)! thanks in advance! | |
I am writing a number guessing game, but it request to give hints to player when he guess wrong. And I need to narrow the range to be the hints, what should I write to do this function? | |
[code] float decimal = 2.345324 float dec_points = decimal%1; [/code] hey guys, I have a small but trivial problem... i have been trying to do the above but i keep getting a error... "error C2296: '%' : illegal, left operand has type 'float'" Anyone got a clue? Thanks guys! | |
HI can anyone help me to write this programe in c Q ; WRITE A PROGRAM TO DETERMINE AND PRINT THE SUM OF THE FOLLOWING HARMONIC SERIES FOR A GIVEN VALUE OF N; 1+1/2+1/3+14+....................1/N THE VALUE SHOULD BE GIVEN INTERACTIVELY THROUGH THE TERMINAL | |
Hi, this C program is to remove duplicates. HOwever it doesnt always print out a result and when it does it screws it up sometimes. [CODE]# include <stdio.h> # include "simpio.h" # include "genlib.h" main() { int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,word; word=getchar(); a='a'; b='b'; c='c'; d='d'; e='e'; f='f'; g='g'; h='h'; i='i'; j='j'; k='k'; … | |
hi everyone, i have a program code here, its working, but as soon as im trying to add results debugger breaks after adding score, can anyone help me to fix this problem. Program is working ok. heres the code: [code] #include <stdio.h> #include <string.h> void addTeam(char[50], int); void calculateResult(int, int, … | |
I know this forum isn't for databases but I couldn't find a proper one so i post here. (my original post is at forums.mysql.com, but not much seems to be happening there) can MySQL server be started as a globally accessible server by using libmysqld? For example, can a application … | |
hi, i have been unable to solve a problem related to C (i'am a newbie girl). I've googled around and maybe I have a flat learning curve :-( the fact is that i need to write a program that reads from a .txt file and print the output to another … | |
Hello, is me again, im trying to improve my program with another function it should print as many senteces on one line in the output, as user will enter as the parameter in the command line sentenece is characterized with sign '.' if you have sentences wchich ends with '...' … | |
I made a program that finds the ROT 13, but theres a little thing thats messing it up for me. Its supposed to find the ROT 13 of each character but when i run it, it gives me some funky character in return [CODE]#include <stdio.h> #include <string.h> int rot13(int c) … | |
a 'c' program to find the factorial series for n values............. | |
Hey All, I am a newbie in C programming. I have written a program which has a separate function to send messages to 2 neighbours in the same network. This function is called from the main program. Also I have a thread which is created by the main function. The … |
The End.