Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~4K People Reached
About Me

My name is Maroun.
I'm 25, a computer engineering student at the Hebrew University of Jerusalem.
I'm in love with sports.. specially soccer :)
Pianist and a Keyboardist since 5 years old.

Favorite Tags
c x 33
c++ x 10
Member Avatar for MarounMaroun

Hello, I'm trying to read lines from a file and strtok it into a double array to work with the numbers. The numbers are separated by ',' and I'm trying to fill array (line[]) with these numbers. This is part of the code. [code=c] while(1) { //we will scan all …

Member Avatar for Ancient Dragon
0
125
Member Avatar for MarounMaroun

Hello guys, I have this function: [CODE=c] void swap(char **a, char **b) { char *tmp=*a; *a=*b; *b=tmp; } int main() { char *str1="aaa"; char *str2="bbb"; swap((char **)&str1, (char**)&str2); return 0; } [/code] The program runs and really swaps the two strings. I don't understand why we send (char**)&str1 and (char**)&str2 …

Member Avatar for Narue
0
136
Member Avatar for MarounMaroun

Hello folks, How can I fill a 2D-array (of size [1260][4]) with all variations of 1-10 (which is 5040 variations)? 1 2 3 4 1 2 3 5 1 2 3 6 .. .. 1 7 4 9 .. and so on.. Thanks!

Member Avatar for frogboy77
0
92
Member Avatar for MarounMaroun

Salam, lets say I have declared: [code=c]int* array=new int[SIZE];[/code] (I used this array as if it was a 2D array - lets say that I'll consider these dimensions: row, column). and I want to pass this array to a function that will fill the array row by row. (The function …

Member Avatar for abdelhakeem
0
137
Member Avatar for MarounMaroun

[code=c] #include <cstdlib> #include <iostream> static void fillArray(int **array); int main() { //allocating a 2D array int **array; array=new int*[10]; for(int i=0;i<10;i++) *(array+i)=new int[5]; //sending this array to a function fillArray(array); for(int i=0;i<10;i++) for(int j=0;j++;j<5) std::cout<<array[i][j]; for(int x=0;x<10;x++) delete[] array[x]; delete[] array; return 0; } static void fillArray(int **array) { …

Member Avatar for alexchen
0
82
Member Avatar for MarounMaroun

Hello guys, I'm a 2 year computers engineering student. I'm a good programmer in c, c++ and java. MY mission is to create a software(with a graphical interface) that handles an electronics shop. My software should know how to insert an item, to delete it, to check if expired or …

Member Avatar for everhett.raman
0
121
Member Avatar for MarounMaroun

Hello guys.. I have this makefile: [CODE=c] MyMatrix‬‬: MyMatrix.o gcc MyMatrix.o -o MyMatrix MyMatrix.o: MyMatrix.c gcc -c MyMatrix.c MyStringMain: MyString.o MyStringMain.o gcc MyString.o MyStringMain.o -o MyString -o MyStringRun MyStringMain.o: MyStringMain.c MyString.c MyString.h gcc -c MyStringMain.c MyString.o: MyString.c MyString.h gcc -c MyString.c .PHONY:clean clean: rm -f *.o test.out [/CODE] For some …

Member Avatar for MarounMaroun
0
217
Member Avatar for MarounMaroun

Hello all, I have this code: [code=c] void SetMatrixRange(MyMatrix * matrix, int xfirst, int xlast, int yfirst, int ylast, int zfirst, int zlast, int value) { int i,j,k; for(i=xfirst;i<=xlast;i++) for(j=yfirst;j<=ylast;j++) for(k=zfirst;k<=zlast;k++) matrix->m[(i*ylast*zlast)+(j*zlast)+k]=value; } [/code] I allocated the matrix like this: [code=c] MyMatrix * CreateMyMatrix(int x, int y, int z) { …

0
64
Member Avatar for jane bella

i need a help in airline reservation system project in c n i dont no how to do that so plz tell me the codes for these we should allow the user to chose 1)to book 2)to cancel 3)view data 4)quit as well as they have to enter them name …

Member Avatar for jane bella
0
179
Member Avatar for MarounMaroun

Hey all, I'm trying to implement a function InitMatrix which suppose to return a pointer to a new created 3d array of the size determined by x,y and z. I have a struct which represents a matrix and should be able to deal with some functions required, like setting the …

Member Avatar for Ancient Dragon
0
293
Member Avatar for MarounMaroun

Salam, My mission is to program a cube[I](given its dimensions (x,y,z))[/I]. The cube will be represented in a struct, which I'll choose what data members it should contain. I need to implement the allocation function(which actually creates the matrix) and some other functions. The most important function is the setter …

Member Avatar for myk45
0
106
Member Avatar for MarounMaroun

Hello guys, Can someone explain what is going on on this code? 1. why we needed **p in the function [B]AllocString[/B]? 2. why if I change [B]AllocString(strlen(s), &copy);[/B] to [B]AllocString(strlen(s)-7, &copy);[/B] I can still get a good result? Thanks! [code=c] #include <stdlib.h> int main() { char *s="example"; char *copy=NULL; AllocString(strlen(s), …

Member Avatar for MarounMaroun
0
101
Member Avatar for MarounMaroun

Hello all, I have this struct: [CODE=c] typedef struct cell { char _name[2]; int _calcResult; int _depend[MAX_CELLS]; } Cell; [/CODE] and this is my main: [CODE=c] int main(int argc, char* argv[]) { FILE *fp; int i; fp=fopen(argv[1], "r"); Cell Cells[MAX_CELLS]; fillNames(fp,Cells); for(i=0;i<4;i++) printf("%s\n", Cells[i]->_name); } [/CODE] [CODE] static void fillNames(FILE* …

Member Avatar for sree_ec
0
142
Member Avatar for MarounMaroun

Hello folks, I have this header file: [code=c]class Agent { private: struct AgentStruct { std::string agentName; double pID; double mID; AgentStruct *nextAgent; } *AgentP; public: Agent(std::string); void SetNextAgent(AgentStruct*); Agent* GetNextAgent(); void SendMessage(); void ReceiveMessage(); };[/code] and I have the implementation here: [code=c]/* * The constructor we are required to implement. …

Member Avatar for mike_2000_17
0
140
Member Avatar for dany12

My name is Dany I am an It passionate I like to discover new things,find new solutions for problems like those when you get a virus and you can get ride of it and many other things. I would like to say that daniweb forums helped me a lot in …

Member Avatar for mackone
0
160
Member Avatar for MarounMaroun

I'm glad to be a member in this wonderful Forum. I hope I can help, and find answers to my questions. My name is Maroun and I'm from Haifa. Salam to all!

Member Avatar for MooGeek
0
81
Member Avatar for MarounMaroun

Hello All, I'm new here, and glad to be part of this wonderful and helpful site. I'm trying to allocate a new array (lets say of size 10) inside a struct. I want to do it this way: [code=c] #include <stdlib.h> #include <stdio.h> typedef struct Circle { int *x; int …

Member Avatar for MarounMaroun
0
1K