Beginners - January 2014 (Page 19)

Can't define a function in struct
 
Tried to google the solution, couldnt find anything. #include <stdlib.h> #include <string.h> struct student { char name ; char subject ;...
[4 replies] Last: Got it. Changed the name of the file, and it worked. thank you. can u... (by codewalker)
by Jazpy
memory corruption when inserting elements into vector
 
Hello, I'm trying to create a fractal design with C++ and OpenGL, however I've run into trouble with the function that modifies a vector of vertices in order to...
[2 replies] Last: Thanks you very much, keskiverto, It's working great now (by Jazpy)
Can't constructors be call in other methods?
 
I'm writing an explicit assignment method, i find a big block of codes are same as copy constructor, I tried to call the copy constructor, but failed, why? Can...
[2 replies] Last: I'm writing an explicit assignment method, i find a big block of code... (by Cubbi)
Declaration variable of type specified by string value
 
Hello. I wonder if there is any way to declare variable of type specified by string value. For example, I get "float" and need to declare float-variable. Of cou...
[2 replies] Last: The basic problem is you're treating compile time and run time ideas. ... (by kbw)
Creating portable stand alone application in Visual Studio.
 
Hi folks and gurus, I am an absolute newbie. I just wrote a simple program for temperature unit conversion from deg F to deg C as a my school assignment in V...
[11 replies] Last: By being a Windows executable, it is not portable but is, by definitio... (by LB)
undefined reference to `swap'|
 
Hi all! it's my first time posting on this forum altho, I used it for a while now. I tried to find the problem in my code when writing a simple swap function wi...
[6 replies] Last: Nah, i just defined it wrong. after few tries and some google. i defin... (by Simon Izraev)
by Nata
Vectors. I do not understand why my program is not right. help me out please:)
 
I should input cin n integer, which will be stored in a vector. From positive numbers I should cout max and min numbers. and also I should copy positive numbers...
[8 replies] Last: Thank you very much!!! (by Nata)
What is the difference?
 
what is difference? 1) c = (f-32)*5/9; // result OK. 2) c = ((f-32)*5)/9; // result OK 3) c = ((f-32)*(5/9)); result is 0 Why c (result) is always 0 in ca...
[7 replies] Last: You're welcome. (by MikeyBoy)
by xkara
How to filter out integers in a string of Vectors
 
I am new to C++ and the code below is a general concept of what I have std::vector<string> x; std::cout << "Please enter in values "; std::string numbers; s...
[3 replies] Last: You could use a string stream and stream the numbers and discard or st... (by giblit)
Working with Arrays of Objects
 
In my main.cpp function, I'm trying to print out an array of objects which I called "Friends." When I try to do that with my printArray function I get an error ...
[5 replies] Last: Yeah what I was trying to do is this. (This may be what you said) Her... (by JRimmer)
by cmog
if statement trouble
 
Hi, this is like only like my third c++ program, so I apologize if it is riddled with errors. The problem I have is that the if statement I have coded doesn't s...
[3 replies] Last: Thanks for the tip and yes I do now see that the sign was the wrong wa... (by cmog)
by venros
Multiple User/Pass - While Loop
 
Hi Guys, I need help with this program, I tried multiple things already but nothing is working. Currently attempting to use the user/pass as a function. #i...
[6 replies] Last: This site has a pretty good reference section :P http://www.cplusplus... (by giblit)
by Tieria
1st project of intro C++ course compiling error
 
I am taking an introductory C++ course and am attempting to complete the first assignment. The task is to type up a bit of code given as a printout and then ru...
[11 replies] Last: After the user enters a number they press enter. Pressing enter genera... (by Yanson)
Trying to figure out
 
Hi, new to this. I am trying to figure out where I am going wrong with this code. Thanks #include <iostream> using namespace std; int main () { int midt...
[5 replies] Last: Im trying to figure out this sorry I thought it all went in thank you ... (by nwhis001)
by slour
Add values (1,2)
 
I am in need of help writing some code to open a file take two values, then add them together and output them to another file. I have very little programming ex...
[31 replies] Last: Look at line 4 very clearly...I have no idea what that is supposed to ... (by giblit)
How can I increase the char capacity? (1,2)
 
This program is supposed to convert a 1-10000 characters line to binary code. When I enter more than 4571 characters the program doesn't output anything, but wh...
[24 replies] Last: Thanks a lot! The problem is in the input method not in the char capac... (by omareg94)
The result does not happen
 
I did this code and my result always shows me 0. double c; double f; int main(){ printf("Entre com a temperatura em Celsius \n"); scanf("%d",&c)...
[6 replies] Last: If control reaches the end of main without encountering a return stat... (by JLBorges)
Translation from C to C++
 
I have debugged this code and it works perfectly fine in C, but I'd like it to work in C++. If anyone can tell me how to translate it, please let me know. ...
[7 replies] Last: Actually I guess C does have bool type (well the recent versions of it... (by Smac89)
expected ';' before '{' token
 
Getting the following error: expected ';' before '{' token. Error is in line 3: for (int i=o;i { void pulse() // output set of pulses { for (int i=0;i { ...
[5 replies] Last: Since for-loops uses semicolons to separate them, you need to add one ... (by ngbeslhang)
help with open GL (C++ 2008)
 
I want to draw a car and house but I could not set the vertex of them even though I did draw square ,triangle and pyramid. So who can help me out in this
[2 replies] Last: Opengl is a language agnostic standard. There are bindings for many l... (by closed account 3hM2Nwbp)
January 2014 Pages: 1... 1718192021... 44
  Archived months: [dec2013] [feb2014]

This is an archived page. To post a new message, go to the current page.