- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
My friend and i were having a discussion the other day and we were having a heated argument about how to make that dang diamond pattern in C++ code...does anyone remember how to make that thing? like this?[TEX] * *** [/TEX] |
|
I'm trying to make a 50x50 board of 50 pixel by 50 pixel squares. However, when I run this code, it only gives me one square. Does anyone have any idea what I'm doing wrong? [CODE] #include <iostream> #include <allegro.h> using namespace std; int xgen = 0; int ygen = … |
|
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 … |
|
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 … |
|
Hello, I am new to c and up until now i have understood it pretty well. I am having a difficulty writing a program that lists the characters in a phrase entered into the program. I think my problem is with the loops and maybe some variable declarations. None of … |
|
I have the following code, [code=C] main() { char *p="abc"; int x; x=++*p++; printf("%d",x); } [/code] My question is, when I try to do x=++*p++, the program crashes. If my associativity rules are right, first the address pointed to by p should be incremented by the postfix (p++) and then … |
|
I have tried different things to modify the following code and have been unsuccessful. The following code is to get the julian date number. I need to alter it to make it return the day number (between 1 - 366) within a given year. Can anybody help? (fyi - this … |
|
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 … |
|
hello everyone.. I have been given an assignment to do a mini project in my college using C.As such im in dire need of ideas for the same. I need ideas for programming games,innovative programs etc.. till date they have taught us C pointers structures & arrays.. So ill have … |
|
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? |
|
Can anyone suggest a book from which I can learn Window based C programming ? |
|
[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 … |
|
Hi everybody, Im a new member on this forum and I want ur help on C language. Im a new student on this language & mostly we study it by our-selves. This is the question: > One of the academic staff is trying to keep track of the students and … |
|
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, … |
|
Below is the code which is supposed to round to two decimal places, i.e. 1.2874 is suppose to round to 1.29, but rather gives me 128.0000. What am I doing wrong need help fast! #include <iomanip> #include <iostream> #include <cmath> using namespace std; double roundIt(double x, double n) { x … |
|
Hello everybody, i need a polygon formula to draw one. I want to make a function that will draw a polygon , depending on how many vertex's it has. I'm not good at math so i can't figure it out how to do it. Though, i do understand that it … |
|
Hi, I'm trying to use LogonUser. I think I'm doing everything right, but I keep getting this error: 1326 (ERROR_LOGON_FAILURE). I know my user and pass are right. [Code=C++] #include <stdlib.h> #include <stdio.h> #include <conio.h> #include <windows.h> void GetPassword(char *pass, int maxlen, char hidechar) { char ch; int len = … |
|
On the advise of ~S.O.S~, i checked out code blocks. It's rather intuitve to use. (It has to be, the documentation is very limited.) The debugger works well with it. In fact i used the step function to find a place where i was stuck in a loop. The yellow … |
|
Hi C++ is my first language i am learning and i would like to start some project that involves a bit of AI and object avoidance but i have no idea where to start. My skill in C++ is pretty poor but i would like to start a small project … |
|
Hey there, the problem that I am having is that I'm trying to make a simple scripting language that is coded in notepad, then opens the Engine and it displays the code in a console window. I am currently stuck at displaying text on the screen, if I enter a … |
|
[code]#include<iostream.h> #include <string> using namespace std; struct sdata { char name[5]; int reg; }; struct sub { char subject[30]; sub * move; }; void instudent(sdata & ins ); void show(sdata * ins); class inf { sub * begin; sub * look(int limit) { sub *pointer=begin; for(int i=1; i<limit; i++) pointer=pointer->move; … |
|
Hey what I am trying to do is convert the total amount into Euros, what would the calculation be please? The user enters the current rate of Euro Thank you :) |
|
help me to find out how to make a program about tictactoe game...its really hard..[B].im hoping for an immediate answer[/B]..thanks>>by the way this is only one of my problems to be finished... |
|
how can i arranged the input words alphabetically, like in the dictionary..[B][B][B]please help me....please!!!![/B][/B][/B] |
|
I'm creating a game and I need to rotate this object. Ok i'll make my explanation simple, I have Object1 and Object2.. Let's say Object1 is at coordinates 0,0 (x,y) and Object 2 is at coordinates 10,10... Object 1 is currently facing south, Now I need object 1 to be … |