- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
35 Posted Topics
Re: you mean like this: [code] * *** ***** ******* ***** *** * [/code] | |
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 … | |
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; … | |
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 … | |
Re: 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 … | |
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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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) || … | |
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 … | |
| |
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? | |
Re: please use those first three threads in this forum for that thanks | |
[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] … | |
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 … | |
Re: 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 … | |
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, … | |
Re: 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 … | |
Re: 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() … | |
Re: 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 … | |
Re: 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 | |
Re: 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 | |
Re: 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 … | |
Re: Spaces are treated same as enters, in way they both break strings when using standard string input statements | |
Re: 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 … | |
Re: 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 | |
Re: 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 … | |
Re: 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 … | |
Re: (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 … | |
![]() | |
Re: 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. … | |
Re: 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 | |
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... … | |
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 … |
The End.