15,552 Topics

Member Avatar for
Member Avatar for COKEDUDE

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"; …

Member Avatar for Ancient Dragon
0
179
Member Avatar for blue_Student

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 …

Member Avatar for Ancient Dragon
0
283
Member Avatar for karlicek

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 …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for zaxo311

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 …

Member Avatar for zaxo311
0
429
Member Avatar for Parag ranawat

Sir How can i add my own function in C standard library so pls can u suggest me about it........

Member Avatar for deceptikon
0
32
Member Avatar for nitish.mohiputlall

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. …

Member Avatar for Banfa
0
178
Member Avatar for COKEDUDE

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 …

Member Avatar for COKEDUDE
0
306
Member Avatar for inspire_all

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....

Member Avatar for deceptikon
0
125
Member Avatar for blue_Student

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 …

Member Avatar for deceptikon
0
350
Member Avatar for getmeusername

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 …

Member Avatar for Ancient Dragon
0
161
Member Avatar for Pankaj18

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 …

Member Avatar for Ancient Dragon
-2
1K
Member Avatar for sh0na
Member Avatar for Qazi_1

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, …

Member Avatar for mathijs
0
254
Member Avatar for jursnamo

#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') …

Member Avatar for Banfa
0
154
Member Avatar for rubeea.jaffari

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; …

Member Avatar for rubeea.jaffari
0
193
Member Avatar for MikeBah

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 …

Member Avatar for anas.man
0
189
Member Avatar for selfridgegirl

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 …

Member Avatar for ballrohit
0
156
Member Avatar for yann.bohbot.9

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 …

Member Avatar for yann.bohbot.9
0
143
Member Avatar for yann.bohbot.9

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 …

Member Avatar for Ancient Dragon
0
5K
Member Avatar for nadiam

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 …

Member Avatar for nadiam
0
273
Member Avatar for nadiam

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 …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for jursnamo

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; …

Member Avatar for Ancient Dragon
0
246
Member Avatar for richieking

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 …

Member Avatar for deceptikon
0
2K
Member Avatar for yann.bohbot.9

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 …

Member Avatar for Ancient Dragon
0
252
Member Avatar for satys.sara

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 …

Member Avatar for Ancient Dragon
0
110
Member Avatar for senokuza

#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 = …

Member Avatar for senokuza
0
294
Member Avatar for yann.bohbot.9

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 …

Member Avatar for yann.bohbot.9
0
350
Member Avatar for stef1047

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 …

Member Avatar for Ancient Dragon
0
139
Member Avatar for karma2you

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 …

Member Avatar for Ancient Dragon
0
241
Member Avatar for gruntler

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 …

Member Avatar for gruntler
0
387

The End.