15,552 Topics
| |
I've seen a few different ways to convert a string to ascii and I was wondering what is the best way and why. char str[100]; int i=0; printf("Enter any string: "); scanf("%s",str); printf("ASCII values of each characters of given string: "); while(str[i]) printf("%d ",str[i++]); ----------------------------------------------------------------------------- int main() { char *s="hello"; … | |
I don't know what's wrong but the succeeding strings are not properly read by fgets. else { initArray(word1); //first string fgets(word1, 29, fileIn); printf("word1: %s\n", word1); len = strlen(word1); if(word1[len-1] == '\n') word1[len-1] = '\0'; while(!feof(fileIn)) { //succeeding strings in next line initArray(word1); fgets(word1, 30, fileIn); printf("word1: %s\n", word1); len … | |
Hi everybody, I would need and advice. I work with binary tree in language C and I wanna to save data from binary tree to file. I try to make similar way to C++, but proposed code notice failure. How I modify it to put it into operation. that's the … | |
I have following problem: I have 2 structures: Clients and items for example structure clients would have name and list of items from another structure asigned to this specific name I have to do this with singly linked lists. I simply have no idea how to do this would be … | |
Sir How can i add my own function in C standard library so pls can u suggest me about it........ | |
Here is my question: Write a program that reads from the keyboard an initial balance b, the annual rate of interest r and the projected balance you want to reach. The program should then display the number of monthe it will take for the balance to reach the projected balance. … | |
Is there a way to read a file character by character for chars and the number set for numbers? bob 4567 joe 39083 sara 4239824 That is my file while ((c = fgetc(pFile)) != EOF) { //my work } I know this works on my chars. This won't read numbers … | |
Please can anybody explain me the following things below:: 1.What is a hashmap 2.Its use 3.What do we do to avoid collisions.... | |
Hi, I've been testing about converting infix to postfix expression. I've made the code and it compiles. My problem is it stops working when I run it. This involves the use of stack and arrays. I just call the method polish to get the strings infix and postfix, and to … | |
Hello Friends, I am new to c programming. I want to create data structure for client server communication. I can simply transmitt simple char to server and return it back. My requirement is to have dynamic number of variable in client side i.e my client should be able to transmitt … | |
Hi, i want to create a program like below Write ‘C’ language program for maintaining a phone book. Your Program should allow user to “ADD”, “DELETE”, “MODIFY”, “SEARCH”, “Display All Records” and “COUNT” records. All data should be stored in text file and should be available whenever the program is … | |
I want to self similar traffic (by using pareto distribution) in Simulink. | |
Hi guys, Tomorrow is my theory paper exam of C++ OOP and Data Strucutre. Paper will be based on 50% theory Q/A and 50% on coding implentaion. Can you give me some hints to prepare for this coming exam? PS. I have gone throw all lectures slides and course material, … | |
#include <stdio.h> #include <stdlib.h> int buku; int jum; int total; char member; int main(int argc, char *argv[]) { printf("\n---------Tarif Peminjaman Buku-------\n"); printf("Member Rp.5000.oo,-\n"); printf("Non-Member Rp.15000.oo,-\n"); printf("Regist Member Rp.30000.00,-\n"); printf("-------------------------------------\n"); printf("Silahkan Masukan Pilihan Anda\n"); printf("Jumlah Buku : "); fflush(stdin); scanf( "%d",&jum ); printf("Apakah anda member [Y/T]"); fflush(stdin); scanf("%c",&member); if (member !='y') … | |
Can someone please rectify the mistakes in the following code? Thanks in advance #include #include #include #include "org_suhail_keylogger_HelperClasses_NativeMethods.h" #include "KeyMap.h" static HANDLE hookThreadHandle = NULL; static HHOOK handleKeyboardHook = NULL; static DWORD hookThreadId = 0; static jmethodID callBackToDeliverKeyStroke = NULL; static jmethodID callBackToStoreKeyStrokesAsHtml = NULL; static jmethodID callBackToStoreWindowName = NULL; … | |
| I've been given the following instruction: *Add a new method to the library that applies a function to every value in the tree. (This is an iterator method for trees.)* int bst_char_iterate(bst_char *t, char (*fun)(char item)) *NB: The BST property will only be preserved by this method if the function … |
hey all!! i m making a program in which i want to search record by name, year and, enrollment no. my code is working only for the first record of a file , its not usfull for second record or any record after the first record i've tried toooooo much … | |
Hey everyone, I have a code here with me and I'm having trouble putting my conditions. I'm basically putting a string and I have to split it into 4 and atoi to change a char to an int but basically when I run the program failed. It tells me "Ordered … | |
I'm having a small issue here with my linked list. I built a linked list with strings and it worked perfectly. Now since i'm using strtok() to separate the string I need help on storing the struct separately but keeping them connected. Hope i explained it well for now here's … | |
there is a very frustrating problem with my queue linked list. the functions all work its just that after enqueue, dequeue or display the menu displays along with "Enter choice : Only one of the above can be your choice ". whats wrong? #include <stdio.h> #include <conio.h> #include <ctype.h> #include … | |
so this piece of coding is having a problem. namely the search funtion. it will search but the result would only be the first element. the second will not be seached. like for example first element is lily and second element is john. search for the name lily will result … | |
i have program C++ but i will convert to C How to convert C++ to C? #include <iostream.h> #include <conio.h> struct mahasiswa { int nbi; char nama[50]; char alamat[50]; int telp; }; void main() { int pilihan,pilihan1,T; menu: mahasiswa data[3]; cout<<"Pilih Menu :"<<endl; cout<<"1.Input Biodata"<<endl; cout<<"2.Tampilakn Semua Data"<<endl; cout<<"3.Cari Biodata"<<endl; … | |
This is a basic CPP sleep fuction. As you can see CPP libs do not come with a time sleep/wait fuction to use in your code/loop. So due to boring jurney to Saint Petersburg, i decided to write something/code to give anyone who has been wondering why CPP does not … | |
Hey everyone, I posted recently an issue that was almost resolved but I have a similar question but have different variables. I'm really new to C and I'm a bit confused. Like I said on the other post I need to seperate a string using strtok() and store the seperated … | |
Hello all, I have a question on how to use strtok funtion for the below scenario. A1.1*7.1&9.1&11.1/ I want to parse through & and make it as null (before 9.1) and once after I should pick the start end range between *. Say here 1.1 is start range and end … | |
#include<stdio.h> #include<stdlib.h> #include<string.h> #define sizeofhash 30 struct nsbh { char nama[100]; char norek[20]; char ttl[40]; char jk[20]; char alamat[30]; char kota[50]; char nohp[15]; int saldo; struct nsbh *next; }; struct nsbh bank; typedef struct nsbh atm; atm *hash[sizeofhash]; atm *a=NULL; atm *b=NULL; atm *c=NULL; //Nasabah bank; //Nasabah * pbank = … | |
I'm new to C and I i have an assignment where I have to build a dictionary (Linked List). Basically the user inputs several words,year and their definitio likn this: Example: > love_#_2004_#_LOVING `trade_#_2001_#_INVEST` etc... Now what I need is to have a function that will scan the definition which … | |
hi guys ... can you help me with an example of arrangements records either to modify, delete or search is that I will perform a program in c to enter, modify, delete and search data simply as integers but still not mastered well as that I mentioned before and if … | |
This semester is my first programming class and I am really struggling to complete this project. I just can't get a handle on this.I know its simple but my program is not running. Can someone help me and explain it ? Here are the rules(outline): - You must ask the … | |
I am trying to make a program that generates source code for a much larger program for simple reversal encryption. I don't know what I am doing wrong. Here is my code so far: #include<stdio.h> int main() { FILE *fp; fp=fopen("d:\\crypt.h", "w"); fprintf(fp, "char out[8];char cur[8]; char con[255,255,255,255,255,255,255,255];/n if cur==con … |
The End.