15,551 Topics
| |
Hi, what would be a easy way of taking chars from the BEGINNING of a string, and placing them in another variable, ensuring that they are removed from the original string, ideally at the same time? basically, say i have 2 strings, string1 and string2. string1 contains "helloworld" string2 is … | |
if i have a list kinda like this "name" bobby "endname" "age" 34 "endage" "name" susie "endname" "age" 53 "endage" how would i sort through it ignoring the stuff in "" and copying just the names and ages into arrays. ive been using strtok and if statements but that doesnt … | |
Hello World! I am new to C and would like to write a C program to accomplish the following: I have an external 600GB USB disk device, Padlock Pro. The device, which can be seeing at: [url]http://www.amazon.com/Apricorn-Encrypted-Portable-External-A25-PLe256-640/dp/B003EYVJTU/ref=sr_1_1?ie=UTF8&qid=1298479333&sr=8-1[/url] has a number pad on it. It uses a maximum key of 16-digit, … | |
Is it possible to create programmes to run on coumputers thad do not have any operating systems? :evil: :cheesy: :sad: | |
So I converting a decimal value into hex, but I need to print it out from an array. I'm not sure where to go from here. [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> int hexa = 16, deci, quotient, p; void dec2hex(unsigned int x, char hex[]) { for (p = … | |
how to connected data base(sql) with c language......? with exampal...? | |
hi! good day im a newbie and trying to learn functions in C. and im having a problem with functions. int charges (int l, int w) { int c_charg; c_charg = 8.23 * area; } l = 6, w= 3, and area = 18 problem is 'c_charg' is assigned a … | |
i allocate memory for b_edge in function bark_edge and give value to only b_edge[1][1] and try to return b_edge from function. segmentation fault comes? can you please check why? [CODE]//function bark_edge+main program #include<stdio.h> #include<math.h> #include<stdlib.h> double **bark_edge(); main() { double **b_edge; b_edge=bark_edge(); printf("%f",b_edge[1][1]); } //FUNCTION-bark_edge double **bark_edge() { int i=0; … | |
segmentation fault comes in the program? please help? is there any way i can check in which part of the program is the mistake? Thanks daniweb and members... [ICODE] //function bark_edge+main program #include<stdio.h> #include<math.h> #include<stdlib.h> double **bark_edge(int f_size,int samp_freq); double **transpose(double **x,int M,int N); main() { int f_size=1024; float samp_freq=44100,fcmax=samp_freq/2; … | |
[B]Hello To All Programmer:),,,im a beginner plzz help to make this program.. Make a program of am institution using manual system flow and convert it to computerized system using Turbo C program..:S the institution is Boutuque.. plzz help me...TY programmer,,[/B] | |
How do I read and print just n(10) lines in a file and not whole file. [CODE]#include<stdio.h> #include<string.h> int main() { char line[50]; FILE *datafile; datafile = fopen("/data3", "r"); while(fgets(line,sizeof line,datafile)!=NULL) printf(" %s\n", line); fclose(datafile); return 0; }[/CODE] | |
Hi guys I have some problem regarding getting prime factors and distinct prime factors. I manged to get the prime factors but I got stuck on how to get the distinct prime factors.........I don't know how to select unique prime factors and print them....Help me out guys........ Thank you in … | |
Not sure why my comparisons aren't working between my input (text) and my several char arrays. I'm trying to get the user's input to terminate certain functions as you'll see below. I realise it's not the most efficient code but if there's anything obvious I'm missing please let me know. … | |
[CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct { int count; // counter to use the word's occurrence char word[99]; } word; char str[99]; word myword[50]; int main() { FILE *myfile; if ((myfile = fopen("wordlist", "r")) == NULL) { printf("\n Error:Can't open file \n "); exit(0); } int position = … | |
Question:Write a program which prints " Testing C Skills" without no use of semicolon. I have found one answer : [CODE]1. #include <stdio.h> 2. void main() 3.{ 4. if(printf("Testing C Skills")) 5. {} 6.}[/CODE] | |
[CODE]#include <stdio.h> #include <string.h> typedef struct { int count; // counter to use the word's occurrence char *word; } word; int main() { word myword[50]; FILE *myfile; if ((myfile = fopen("wordlist", "r")) == NULL) { printf("\n Error:Can't open file \n "); exit(0); } char str[99]; int position = 0; while … | |
Hello I have been working on this program for a few days and have gotten stuck. I allow the user to enter in a string and remove special characters and turn upper case characters to lower case. after all that is done i compare the characters in the string to … | |
Hi, I am writing a piece of code that takes copies the contents of one file to another (which is created by the code, the name is given by user as an arguement). I've managed to successfully open and read in the source file, and the program will create the … | |
Hello all. I've previously created a working socket program in C in a 32-bit machine and now I have to transfer it to a 64-bit machine. May I ask if there is anything I have to change in my program to make it work in a 64-bit machine? I did … | |
i have sample for to find out prime number , but i want to optimise is more. can anyone plz help me. int i; for (i=2; i < num ;i++ ){ int n = num%i; if (n==0){ System.out.println("not Prime!"); break; } } if(i == num){ System.out.println("Prime number!"); } thnaks in … | |
I need to read a text file and change each character into morse code, then send it to another file. is there an easier way than having 26 different arrays associated to a different letter? | |
Hey I am writing a double linked list dictionary of sorts. All of my functions were properly (add element after, move pointer, search, etc.). However, something is wrong with my add before function. Initially it adds elements fine, however if I decide to move the pointer to a new element … | |
I'm supposed to read all the words from text file and use bubble sort to sort the word and count their occurrence. As I read each word from file, what is the exact thing I need to do? Do I need to store the word (as char array) somewhere to … | |
I've spent several days looking for info about precisely how to do DLLs and have found bits and pieces here and there but noplace that ties it all together. I'm thinking this could grow into a 'how-to' for DLLs which might be useful for others as well. I'd like to … | |
This program keeps adds the sum of numbers you put in. You can also quit by typing in quit, its not case sensitive since I have code which converts all uppercase letters into lowercase. This in fact is the problem. For some reason when I insert a number it works … | |
Can anyone fix my problem? I'm sure my getDate function algorithm was right, but it still wrong.. here is the code: [code=c] #include<stdio.h> #include<string.h> #include<stdlib.h> typedef struct{int day,month,year;}Date; typedef struct{ char name[31],gender; Date dob; }Student; void getString(FILE* x,char* y); Date getDate(FILE* x); char readChar(FILE *x); int main(){ Student pupil[100]; int … | |
So I have a program that runs a loop in main to call functions to show all seats with their name and to reserve seats. My code works fine to reserve a seat. But when I reserve a second/third/fourth seat the name I enter for that seat overwrites the names … | |
#include<stdio.h> #include<string.h> void fn (int *ptr) { static int val=100; ptr=&val; } main() { int i=10; printf("%d", i); fn(&i); printf("%d", i); getch(); } The output of the above code is 10 10. why not 10 100? What is happening inside fn? | |
Hello... I'm trying to write a program in C (using POSIX library) where the parent process should fork up to M processes and play "connect four" or "four-in-a-row" with each-other until one of them wins, and when that happens, the process should terminate. This can be done either via pipes … |
The End.