15,552 Topics
| |
I'm having some issues using itoa I can't seem to figure out. The principle is simple, I am using a 2dimensional char array. For dealing with quantity I use atoi to make it all happy and then I want to use itoa to convert it back into a string because … | |
Hello, I am trying to pass in a long int value and return an array of pointers which is processed in a function that converts long to hex. The array doesn't seem to return from the function. I get an error of the type " type mismatch in redeclaration of … | |
Hi there everyone! I've created some functions that decypher the [URL="http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher"]vigenere code[/URL] from a text file, taking care of the frequencies of each letter and all that boring stuff. Now that I have the key, how can I decrypt some words that they (the teachers xD) give me? It'd be … | |
I realize that nobody seems to use Open Watcom's C/C++ compiler but it's the only precompiled C compiler for Windows which compiles code to Linux (I tried building GCC in every way imaginable without success). I've successfully built a few hello world programs without much trouble. However, with a bigger … | |
hello i have to write TCP socket program that mimic SSL handshake protocols. and I do not know where to start my socket programs for Client and Server should be able to communicate with each other. and I want Demonstrate this by sending a packet from Client with the phrase … | |
I wrote a few code to test fork like following: [code]#include <stdio.h> #include <stdlib.h> #include <assert.h> #include <signal.h> #include <errno.h> #include <unistd.h> int DemoFork() { pid_t pid,par_pid; par_pid = getpid(); pid = fork(); switch (pid) { case -1: printf("failure!\n"); break; case 0: printf("I am child!, parent is %d(\n",par_pid); break; default: … | |
this program is supposed to sort an input list and then remove all duplicates. so I'm not quite sure what is wrong with my program, but the output for the original list is a very long list of the same random number(it doesn't change with the input numbers) and the … | |
Hi, I need an array of approx. 2,00,000 elements.But malloc fails to allocate beyond 65872. When I give (short int*)malloc(sizeof(short int)*65000); It works but seg faults when I give (short int*)malloc(sizeof(short int)*66000); whatsup with that? | |
Hi, I am new to programming.. and am studying IT at Uni Over the weekend, I managed to write a java class that handles errors and loops until receiving valid input for a range of different datatypes. I am looking to write something like this in C (as my other … | |
[code=c]#include<stdio.h> #include<stdlib.h> #include<conio.h> #include<string.h> void main() { FILE *fp,*ft; char another,choice; struct emp; { char name[40]; int age; float bs; }; struct emp e; char empname[40]; long int recsize; fp=fopen("EMP.DAT","rb+"); if(fp==NULL) { fp=fopen("EMP.DAT","wb+"); if(fp==NULL) { puts("cannot open file"); exit(1); } } recsize=sizeof(&e); while(1) { clrscr(); gotoxy(30,10); printf("1.Add records"); gotoxy(30,12); printf("2.List … | |
Hi i wrote a program which get query from mysql and store in varible in C.but it can't convert Object mysql ro int.any idea?? [CODE]#include <stdio.h> #include <string.h> #include <mysql.h> #include <stdlib.h> int main(){ char *email, name[30], domain[30], query[100], tmp[200]; int i=0,j,k; unsigned int size; email = "test@example.com"; char ch; … | |
Hi I'm trying to write a simple version of the tail program in linux, but I keep getting a seg fault when I run the program. I wrote a simpler version but with fixed number of lines to print and using [code] char lines[10][100]; [/code] instead of [code] char **lines; … | |
My project is all about queue implementation... please write me a code about calculator with queue. tnx. | |
I have this piece of code wherein I want p to point to array index with value 10 struct_a { int value; ... } There is an array of struct_a. finditem looks through the array to find one with value = 10; main() { struct_a *p; fixup_p(p, 10); } void … | |
I'm a student trying to teach myself C. I know the basics of it and now I would like to write a simple DLL using the WinAPI so I can use it in another BASIC-like language. I'm using CodeBlocks with the compiler it comes with (since I can't afford to … | |
Hi guys, I am currently doing my assignment. It requires me to create a program that will be able to create an address book using File.So far, I managed to display all the contacts, search the contacts and delete the contacts. But , I m not able to sort the … | |
Thanks in advance for any one who helps me. Code is in C using unix system calls. I am writing a code that forks a process and that forked process gets worked on by a function, in my case its called processone. I had a similar program, in which i … | |
[code]include<stdio.h> #include<conio.h> void main() { char u,pp; printf("\n\n\t\t enter the username and password"); scanf("%c%c",&u,&pp); getch(); }[/code] what was wrong in this code, Its taking the username but its not properly taking the input of password. And my another doubt is how can i use string for this program instead of … | |
Hi,Can anyone help in FEC coding in C++,I tried a lot but m not getting the logic. Atleast anyone can suggest me the logic. Thanks | |
I have a file like this: [CODE] 2 | H| 2 | H| 2 | H| 2 | H| 2 | H| 2 | H| [/CODE] & this code to read it in: [CODE] f = fopen(p, "r"); char *t[100]; int i = 0; int i2 = 0; int n … | |
Im having some trouble in forking. All i want to do is to create a child process and under the child process i need to create a grand child..here's my code #include<stdio.h> #include<stdlib.h> #include<unistd.h> int main(int argc, char *argcv[]) { int val; val =fork(); if(val==0){ printf("Child process running\n"); printf("Child:%d PID:%d\n",val,getpid()); … | |
every thing works till the fopen, the sprintf works as i'm printing to check that. i just doing know what is causing this not to work it prints "cannot open (null)" but the filename var does have something assigned to it. any help will be welcomed [CODE="c"] char tmpfilename[10]; char … | |
Here is my source code of inputting and print the matrix: [CODE=C]#include<stdio.h> int main(void) { unsigned int m,n; int a[10][10]; int i,j; int temp; printf("Plz enter the number of rows of Matrix:\n"); scanf("%d",&m); printf("Plz enter the number of columns of Matrix:\n"); scanf("%d",&n); printf("Enter elements for the Matrix:\n"); for(i=0; i<m ;i++) … | |
I need to print to data stream to an output file but I'm not sure how to catch the data. Given example inputfile.txt has 20 data with a structure Michael 000000 m [email]abc@123.com[/email] 50 60 70 [code] #include <stdio.h> #include <string.h> void scanData(struct student data[]); void avgMaths(struct student data[]); void … | |
Create a tic-tac-toe game. 1.First display a welcome message to the game. A player enters her or his name, selects to play first or not, and then start to plays the game. 2.Display a 3 by 3 tic-tac-toe board. 3. The player selects the cell to mark. The computer randomly … | |
hey there, good day, i have a problem regarding a csae study, im a newbie and i dont know what's the problem of my source code...help is badly needed,thanks | |
I want to sub-function the reading and printing data. But it says data corrupted. Sorry for my poor english. Example of inputfile.txt [code] Michael 000000 m michael@abc.com 75 82 90 [/code] [code] #include <stdio.h> #include <string.h> void readData(); void printData(); struct student { char studName; int studID; char sex; char … | |
I am working on a program to rewrite an assortment of integers in increasing order yet they are in decreasing order. I am pretty sure the problem is in my indexMax or sortArray functions but I cant find it. Can anyone help? [CODE]#include <stdio.h> #include "genlib.h" #include "simpio.h" #define size … | |
I want to read an amount of string from the file Given inputfile.txt Micheal Tammy Alex [code] #include<stdio.h> #include<stdlib.h> int main(void) { FILE* input; char name[100]; char temp[100]; input = fopen("inputfile.txt", "r"); while((fscanf(input,"%c ", &name[i]))==1) { printf("%c ", name[i]); temp[i] = name[i]; i++; } } [/code] | |
hello! I need a program that validates the input of time. (in 24hr format) The user enters: hhmmss The problem is, I have trouble with complex programs. I came up with this program, but i know it's too basic for what she wants. I need to have arrays in there, … |
The End.