Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
~7K People Reached
Favorite Tags
c x 45
c++ x 29

35 Posted Topics

Member Avatar for cassie_sanford
Member Avatar for DTV
Member Avatar for Alibeg

Hi guys. I have a question - searched for it for at least an hour (i think more, but nevermind). I have this piece of code: [code=C++] cout << word.getLastWord() << "<---" << '\n'; [/code] It is supposed to call getLastWord method of class called Extract. Method returns a pointer …

Member Avatar for Alibeg
0
231
Member Avatar for Alibeg

I guess i'm missing something basic, but i'm new to C++ and do not know how do these streams behave. Can someone please explain why no text is printed to the screen in the following example: [code=C++] #include <iostream> using namespace std; int main (void) { char *ptr = NULL; …

Member Avatar for Alibeg
0
162
Member Avatar for Alibeg

I'm new to this editor, i used Dev-Cpp, and i heard this is a better tool to program with. Problem is that Code::blocks wont compile this: [code=CPP] #include <stream.h> main () { cout << "Hello world!\n"; } [/code] I switched to Code::blocks mainly because i'm using linux and i cannot …

Member Avatar for chris_mccabe03
0
607
Member Avatar for hket89

you can also make a global variable and edit its contents in your function, so you wont be in need of returning anything to dynamically allocate you can: [code] #include <stdio.h> char *function (void) { char *myArray = "Hello World!\n"; return myArray; } int main (void) { char *arr; arr …

Member Avatar for wheel
0
156
Member Avatar for Alibeg

Hi guys....i have a problem and I hope you can explain me where am I wrong... I am doing some kind of Breadth First Search (BFS) ("some kind of" because this is my first program to use this algorithm) I have an array of size 4^9 (262144 for those of …

Member Avatar for Alibeg
0
182
Member Avatar for RobBrown

You can try to run through the whole AA array using a loop and then copy the index (character) of each element that has value 0 (one referring characters that dont appear in input text) to the end of a new char array. then you copy all the elements that …

Member Avatar for Dream2code
0
232
Member Avatar for rcbhat

being able to modify something depends whether your pointer allows it and whether you string allows it. if you declare pointer like [icode]char const *p;[/icode] you can only use it for reading and accessing different elements of different arrays. but you can not change them using p even if they …

Member Avatar for Alibeg
0
516
Member Avatar for _dragonwolf_

ok...this guy gave you the answer and here's the explanation you have made it a bit too complicated, and that's where you've made a mistake look here (your code): [code] if((i >= 3 && i <= 12) && ((year % 4 == 0) && (year % 100 != 0) || …

Member Avatar for _dragonwolf_
0
245
Member Avatar for Alibeg

i am facing several problems.... first one is: how do i typedef a structure i've seen many ways to do it but im not quite sure which one is the right one. this is what i think how it goes (but dont know why it goes that way) [code=C] typedef …

Member Avatar for Alibeg
0
308
Member Avatar for phalgun_g
Member Avatar for Alibeg

i need something from standard libraries that can help me outputting chars at specific places on my screen...i have seen some commands defined in conio.h but i cannot use it as my compiler doesnt have it and it is not standard and not portable any other libraries or suggestions?

Member Avatar for kenji
0
80
Member Avatar for arka_15
Member Avatar for Alibeg
0
68
Member Avatar for Alibeg

[code]int **p; p = malloc (x * sizeof *p);[/code] sizeof *p - (i am not quite sure, and i was thinking) does it calculate the size of *p as size of double pointer, size of pointer or as size of variable pointed by pointer another exmaple with same [icode]int **p;[/icode] …

Member Avatar for nucleon
0
102
Member Avatar for Alibeg

i have problem passing double pointer to my funciton first i declare: [icode]int m, n;[/icode] i read m and n from user just fine (i've checked that) then i declere: [icode]int farm[m][n];[/icode] and i have a function... [icode]void harvest(int **farm,...);[/icode] and when i call it with: [icode]harvest (farm,...);[/icode] it says …

Member Avatar for Narue
0
225
Member Avatar for jam123

calm down...having that stance may only make someone angry. [code=c] printf ("Enter your Name"); scanf ("%s", stu_name [10]); [/code] [icode]scanf ("%s", stu_name);[/icode] - this is correct way of reading a string (when using scanf). point is you dont give an element of array to scanf (unless you want to read …

Member Avatar for Alibeg
0
145
Member Avatar for Alibeg

I ve just installed ubuntu intrepid ibex (8.10.) on my laptop i have been using it for a while already but i just wanted to clear the system completely so i installed it, put some updates, some programs, but i also installed CodeBlocks using synaptic manager. Everything finished smoothly. Now, …

Member Avatar for Alibeg
0
620
Member Avatar for songweaver

here's your problem: [code] x = floor( x * pow(10.0, n) + 0.5 / pow(10.0, n)); return x; [/code] you forgot to divide x with 10^n after you finished rounding and im not quite sure what is that 0.5 / pow (10.0, n) doing and dont forget that putting tags …

Member Avatar for kbshibukumar
0
141
Member Avatar for Alex_

a is constant, but n*pass changes because n changes i dont know why do you use double pass = 360 / n and after that pass2 = n * pass, do you mean pass2 = 360? and why do you use _n? dont forget about radians, because, i think, sin() …

Member Avatar for Alibeg
0
176
Member Avatar for TheBeast32

im not quite sure, but it seems that your backspace thing doesnt work: [code=C++] case '\b': memset(pass + len, 0, sizeof(char)); if (len > 0) { len--; printf("%c%c%c", '\b', ' ', '\b'); } break; [/code] i think you should swap 'memset' with 'if', because this way you set a block …

Member Avatar for nucleon
0
215
Member Avatar for JRM

So you guys say this compiler is way better than Dev-Cpp? I never used CodeBlocks but im intersted in it. What are things you like more in CodeBlocks than in Dev-Cpp

Member Avatar for TheBeast32
0
159
Member Avatar for abby2589

i thought that you need to initialize a struct in same way you define it. [icode]double cost[/icode] is last defined but is not initialized last

Member Avatar for death_oclock
0
98
Member Avatar for h3llpunk

you need to know how you will tell your program where are your object, how they move, and what are they areas. you should consider making a coordinate system on which your objects are going to move and you should make a function to move main object (or maybe use …

Member Avatar for u8sand
0
98
Member Avatar for Phil++

Spaces are treated same as enters, in way they both break strings when using standard string input statements

Member Avatar for StuXYZ
0
111
Member Avatar for floodemo

try to improve your code by removing unncessary code. it would be far simplier if you wrote: [code] sub *pointer=new sub; for(int z=0;z<4;z++) pointer->subject[z]=n[z]; //You dont need braces if you use only one statement if (x==0) { pointer->move=begin; begin=pointer; } else { sub *last=look(x-1); pointer->move=last->move; last->move=pointer; } [/code] i didnt …

Member Avatar for Alibeg
0
148
Member Avatar for Phil++

you just want to type the amount in dollars, current rate of euro and calculate the euros, all without any menu or everything? i mean TOTAL.EURO = TOTAL.DOLLAR / RATE.OF.EURO

Member Avatar for Alibeg
0
93
Member Avatar for taichou

do you want to make a tictactoe game that works with its own brain or with predefined moves. i mean game is all about fooling the opponent into situations that bring you victory. so you can either make a program that calculates every possible combination or that makes its moves …

Member Avatar for ajay.krish123
0
90
Member Avatar for taichou

i agree with death_oclock and what i type here is actually just more detailed explanation of his suggestion problem is that if you use standard input (keyboard), you will have to make dynamic array, or to predetermine number of maximum words. bubble sort is pretty good option since it's simple …

Member Avatar for ajay.krish123
0
125
Member Avatar for it2051229

(english is my second language and i cant recall how do you call line with no ends, axis is something different i think, well in my language. can anyone tell its name so i can make an edit, thanks) i have an idea, but im not sure if it is …

Member Avatar for Alibeg
0
142
Member Avatar for RenFromPenn
Member Avatar for ravikiran032

you are talking about the oldest, i believe, compilers made. they used (and still use somewhere if they exist) 2 bytes to store a memory location. that number refered to a location in previously determined piece of memory, the segment, which was fixed and was less than 65 536 bytes. …

Member Avatar for Alibeg
0
89
Member Avatar for winrawr

you should try something like this: [code]while ((variable = functionCall())!=0)[/code]... because it seems to me that variable is given the value of evaluation: functionCall()!=0, so you just need to use one more pair of brackets... I hope this helps :D

Member Avatar for winrawr
0
119
Member Avatar for Alibeg

Hi everyone.... Could anyone tell me... I have a C++ program, source and exe. And I have a txt file that acts as a database. That program reads and operates with that database and is intended to be useable on my one site. Now... what I want to know is... …

Member Avatar for Alibeg
0
86
Member Avatar for Alibeg

Name: Alija Nickname: It's not something I could write down in English Height: 1.70m (I'm used to metric units, in imperial it would be... 5' 7'') Weight: 65kg(metric again...imperial...143.3 lb) Hair: Brown Eyes: Brown Location: Sarajevo/B&H Age: 17 Hobbies: Well...small bunch of things... :D Relationship Status: single Fav Music: pop-rock …

Member Avatar for sittas87
0
93

The End.