-
Replied To a Post in Need ideas for dealing with strings of arrays
If you don't wish to re-invent code, feel free to use the dynamic C string library here: see file CvecOfString.h at ... http://developers-heaven.net/forum/index.php/topic,2580.0.html that uses files ... readLine.h Cvec.h -
Began Watching Adressbook in cpp
Hi, I hope you can help me out of this because i really dont understand how to fix this code anymore, i tried and tried and it don't work. When … -
Replied To a Post in Adressbook in cpp
You really have two distinct problems that are easiest/best to be each solved on their own: 1) code a linked list. 2) code a contact list using a linked list … -
Began Watching if else statement for strings
I am having a hard time comparing my if else statements and getting it right. I want to ask for male or female, and if male then I can respond … -
Replied To a Post in if else statement for strings
A more general way to take in data records in C is to use a struct ... maybe something like the example below. (Note the use of several functions to … -
Began Watching C: Print specific fields from structure (searching arrays)
Write a program that will read data about **n** movies (data about a movie is defined in structure). Sort data about movies (criteria of sorting is by title of a … -
Replied To a Post in C: Print specific fields from structure (searching arrays)
For line 52 ... do NOT use unsafe 'gets' ... you can use fgets instead (or use my readLine to read in dynamic C strings of any length, if you … -
Began Watching C: Print existing permutations of a string
Write a program that reads **n** strings (with blank spaces). For each read string, check if it is a permutation of some other read string. If it is, print the … -
Replied To a Post in C: Print existing permutations of a string
I would use a Cvec of dynamic C strings to hold all the strings read in from file. See: http://developers-heaven.net/forum/index.php/topic,2580.0.html Then traversing the Cvec of strings to see if any … -
Began Watching Failing to get the unique code from the file! Pls Help!
I want to make a menu driven program in which I have 4 options 1) input() -Inputs the data WITH A UNIQUE KEY (AND CHECKS FOR REPETION) and writes it … -
Replied To a Post in Failing to get the unique code from the file! Pls Help!
We really can not help you on a free public forum if the code you present has copywrite attached ... how can we copy/edit it then? Also ... over 1000 … -
Began Watching C: String arithmetic
I am having problems to figure out how to do arithmetic operations on positive integers represented as strings (addition, subtraction, multiplication, incrementing and decrementing). I did the addition as following: … -
Replied To a Post in C: String arithmetic
As Dani's @ tinstaafl suggests ... firstly ... to get a design for just simple addition (of large int's of any size) to work, you could use some functions to … -
Replied To a Post in simulation using c++
I just remembered this link that you might like to see: http://developers-heaven.net/forum/index.php/topic,127.msg235.html#msg235 Chapter 06: The Computer rolls the dice … a first simulation ... an interactive project with a little … -
Replied To a Post in simulation using c++
Hi Alfadil, If you get stuck, please post what you have tried (and any error messages) so we can see where you are at and how to help you. Shalom … -
Began Watching Function not returning a string
Please Help me out!! After many tries I'm unable to return a string from a function. Please reply with the corrected code! I want it for my High School. Thanks … -
Replied To a Post in Function not returning a string
You seem to be using C++ ... so use C++ string ... (and this question should then be in the C++ forum.) Another way to get the string you need … -
Began Watching any one can help me to fix this code
i know it's too much long but i really need some help to fix the program errors , am stuck within whole code lines and ma mind went confused .. … -
Replied To a Post in any one can help me to fix this code
> ... airport simulation program > ... the airport has one runway .. > one plane can land (or) one plane can fly (takeoff) but not both (at the) same … -
Began Watching C: Swapping players in a team
Write a function for swapping players in a team. New player (which is read) enters team and replacing the player which is also read. Prototype of function is void swap(TEAM … -
Replied To a Post in C: Swapping players in a team
There are few things about your style of coding that could be improved: /* use Global const (in C use #define) instead of 'magic numbers' */ #define MAX_LEN 31 /* … -
Began Watching C: Sorting and searching data from separated files
Write a program that reads data from binary file **EMPLOYEE.DAT** (employees are proffesors and teaching assistants, assume that the file exists). Split data about proffesors and teaching assistants in two … -
Replied To a Post in C: Sorting and searching data from separated files
There are several steps to the final solution of your problem ... The first step that I would suggest you take would be to get some test data, perhaps like … -
Replied To a Post in find positions of most occurent elem
All you need to do is change the print function to a .... get and fill array function ... like this: void get_positions( const int* ary, int size, int val, … -
Began Watching simulation using c++
I need simple programs written using c++ about simulation , please help! -
Replied To a Post in simulation using c++
A very common beginner level simulation is 'rolling a die' or 'rolling a pair of dice', using rand() to get random values in the range 1.. 6 See what you … -
Began Watching Implementing iterative function from recursive
Write an iterative function **char* conversion(unsigned int num, int base)**, that converts an integer **num** into any **base** **(base <=10)**. How to transform the following recursive function conversion() into iterative: … -
Replied To a Post in Implementing iterative function from recursive
You could form a string and print the reversed string ... (i.e. similar to using a 'stack' to unwind the recursive calls) like this: #include <stdio.h> /* Write an iterative … -
Began Watching find positions of most occurent elem
In order to find the most occurent element I am using: int find( int* arr, int size ) { int count = 0, MostOc; for ( int i = 0; … -
Replied To a Post in find positions of most occurent elem
I would use a struct (with a typedef) to create a data record to track the frequencies of each value in the int array. Maybe something like this ... Firstly: … -
Began Watching Inheritance and Polymorphism
Just begin to study the C++ class. I do not know how to solve the question, Looking for someone to help me. 1. Create a class definition for an object … -
Replied To a Post in Inheritance and Polymorphism
You might also like to see the info/examples here: http://www.cplusplus.com/doc/tutorial/polymorphism/ -
Began Watching How does the -'0' and +'0' work in C?
How do they work? Does -'0' always convert to int from char? Can it convert from anything? And same question about +'0', does it convert only from char to int, … -
Replied To a Post in How does the -'0' and +'0' work in C?
As Dani's own @rubberman has indicated ... the char '0' has the ASCII int value of 48 But you do not need to worry about memorizing that (48) value, as … -
Replied To a Post in What's the problem with my C code? (simple for loops and 2d integers)
No bother ... I enjoy seeing students learn new things. You do realize that char is stored as an int ? See below to see that getchar() returns an int … -
Replied To a Post in Stack
Hi again @Rimaa21, Have you ever heard about the concept of 'backtracking' ? Suppose you were moving a robot about in some maze, and recording every step by pushing them … -
Replied To a Post in Stack
Hi @Rimaa21, How are you progressing? Did the see begiinning coding steps ... and the list examples at the link I suggested? Can you show you show us some code … -
Began Watching What's the problem with my C code? (simple for loops and 2d integers)
Hello, I'm new to C language, and I'm using Visual C as my compiler.. Here's my code: #include <stdio.h>#include <stdlib.h> #include <Windows.h> int i[8][8]; void main(){ int row; int col; … -
Replied To a Post in What's the problem with my C code? (simple for loops and 2d integers)
Try this ... /* problem2.c */ #include <stdio.h> #include <stdlib.h> #define MAX_SIZE 8 void print( int ary[MAX_SIZE][MAX_SIZE], int, int ); /* void main() */ int main() { int ary[MAX_SIZE][MAX_SIZE]; int … -
Replied To a Post in Help in a C++ fucntion
And ... if you would like to see an example of customer order validation, using some of the power of C++, just ask. -
Replied To a Post in Help in a C++ fucntion
In particular, if you wish to validate a pruduct number entered by the user, you could maintain a data stucture of valid numbers, either in a file, or loaded into … -
Began Watching Stack
Hello peopole , i want a program in c that can changes the order of a sentence unsing stack ,please can you help me ??? -
Replied To a Post in Stack
If you will Google "C stack" ... you may be surprised how much is at your finger tips but you never looked to see? A 'stack' is a 'last-in-first-out' (LIFO) … -
Began Watching Help in a C++ fucntion
Hey guys i am having a problem with this function. Its a fucntion to generate bills and i want to add a condition in where if users enters a wrong … -
Replied To a Post in Help in a C++ fucntion
Your code would do well to have a fresh start ... Do NOT use getch if you want your code to be portable. Do not mix C and C++ style. … -
Began Watching problem with hexa to binary conversion
i tried to figure out the wrong here but i donnu why it ignore the part of string converting .. b2 is always equal to 0 in the output .. … -
Replied To a Post in problem with hexa to binary conversion
Try looking here to see some working examples ... http://en.cppreference.com/w/cpp/utility/bitset -
Began Watching how to print it beside each other
Hello good morning...I need help on how print the heart beside each other here is the code.. #include <stdio.h> #include<stdlib.h> #include<Windows.h> int heart() { int i, j; for(i=10/2; i<=10; i+=2) … -
Replied To a Post in how to print it beside each other
What is the output supposed to look like? -
Replied To a Post in queue
> ...using push_front and then pop_back ... you can easily do next menu item. However ... it makes clearer logic ... to 'push_back' to add new customers to the end …
The End.