- Strength to Increase Rep
- +3
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 1
- Upvoting Members
- 2
- Downvotes Received
- 5
- Posts with Downvotes
- 3
- Downvoting Members
- 4
Hey everyone, In addition to... Lazy Foo's Tutorial http://lazyfoo.net/tutorials/SDL/index.php "SDL Game Development" - Shaun Mitchell book are there any other recommended resources (does not have to be SDL) people could suggest? I've already created a console-based text adventure game and am really interested in expanding it into a text-adventure game … |
|
I'm trying to understand how the function encrypt works (linux), but event with this simple example is not working. Any ideas?. Thank you. #define _XOPEN_SOURCE #include <unistd.h> #include <stdlib.h> #include <iostream> #include <string> int main() { const char key[64] = "12" ; /* bit pattern for key */ char txt[64] … |
|
Hi everyone. I have a bit confusion about vector. here is my 2 structs <global>and in the main have vector declared. file name is"report.txt" Have file with meteo readings,like • the meteorologist’s name on duty that day (a string of up to 12 characters) • hours of sunshine (double) • … |
|
I'm not understanding why i'm able to read from the file but i can't write to it. The fstream is open in both modes. Once the program finishes i haven't changed the content of the file. Thank you in advance. #include <fstream> #include <string> #include <iostream> int main() { std::string … |
|
text_data = {apple \n grapes \n straberry}; FILE *fp; int i; char ch; std::string DataVal; std::ifstream in("D:\\test\\file.txt", std::ios::in | std::ios::binary); if(NULL != in) { cout<<"File Open Success"<<endl; in.seekg(0, std::ios::end); DataVal.resize(in.tellg()); in.seekg(0, std::ios::beg); in.read(&DataVal[0], DataVal.size()); in.close(); } else { cout<<"File Open Failure"<<endl; return 0; } * Here I am able to … |
|
I am a first year engineering student and i am very intresred in programming using c++ basically to use it in creating my own search engine.Please anyone to help in step by step as I have started learnig c++ language because I dont have prior kowledge in programming. |
|
Hi, I'm trying to convert a void pointer to a struct pointer.. that's seems very easy but my compiler give me error. Thanks. /home/subi/Personal/Projects/LinkedListUserInfo/main.cpp||In function ‘error_t parse_opt(int, char*, argp_state*)’:| /home/subi/Personal/Projects/LinkedListUserInfo/main.cpp|50|error: expected primary-expression before ‘)’ token| /home/subi/Personal/Projects/LinkedListUserInfo/main.cpp|50|error: expected ‘;’ before ‘null_pointer’| /home/subi/Personal/Projects/LinkedListUserInfo/main.cpp|48|warning: unused variable ‘null_pointer’| ||=== Build finished: 2 errors, 1 … |
|
I am trying to start the odometer reading at 0 to start with, but I want it to increase everytime the user inputs MilesDriven. I can't seem to get it to work...any ideas? [code] //Paul Baker //TRCC Intermediate C++ //Assignment 3, Odometer #include <iostream> using namespace std; class Odometer { … |
|
I love this programme :P [CODE]#include <iostream> #include <string> using namespace std; char lowerCase(char input0 = 0); char upperCase(char input1 = 0); int main() { char character = 0; while(true) { cout << "Enter a Character to change case: "; cin >> character; cout << endl; if(character > 64 && … |
|
Hi all, I have been looking for single function to split strings and seems to me either is not available or I miss it. So I please, help me to know if it is available and if yes where can I get it. Thanks |
|
this is my daughters homework she asked me to help and now im stuck she has worked it out and is making me look stupid need to get my selfrespect back even if i have to cheat(i used my brain and im asking you) the code is as follows but … |
|
hi, I V.Gayatri Devi I am writing the c code in linux for distance calculation using haversine formula I included in my program as #include <math.h> but the sine functions and squareroot functions are not working in my program. instead of using math.h i also used cmath.h but there is … |
|
Hey guys, I'm new to C and I am trying to find a way to create a file with the following array: [code] char peer1_0[] = { 0x0c, 0x4c, 0x08, 0x00 }; [/code] The original array has a lot more data, but I am just needing a simple example or … |
|
Hey, could someone help me out by telling me how I can read in 2 matrices from a single input file? |
|
I am working on a class assignment that doesn't meet for a few more days. The assignment is to open a text file, and parse the file one word at a time, reading each word into one of 26 arrays based on the first letter of the word. I can … |
|
i can't get this to run. my math functions at the end have messed up logic. and the superfluous function headers and such. i don't think the math output is linked to the desired output of the payment. [CODE] #include <iostream.h> #include <math.h> #include <cstdlib> #include <iomanip> //here i am … |
|
Problem: Write a program that has an array of at least 20 integers. It should call a function that uses the linear search algoritm to locate one of the values. The function should keep a count of the number of comparisons it makes until it finds the value. The program … |
|
hii ,, i have a sorted array x[]={1,2,10}, and a "target" i want to search recursively for the sum of the elements of the array with any combination without any repetition of elemt in the array (i.e. if target=11 then we can get it from the array (1+10) but if … |
|
How to make a time based regular function?Like something that plays a sound every 1 second? |
|
Hey everyone,,, tomorrow is my c++ final,,, and am having a problem with a simple code,,, it seems logical but i do not know why it is not working,,, I wrote two function one that get the length of the string and another to reverse the character in the string,,,, … |
|
hi 2 all, I have an assignment about classes, everything IS OK , except of the draw function of a square.(after running the prog. there is no square drawn ) this wt I did till now:[CODE] class Square{ private: int sidelength; char ch; public: Square();//default constructor void setSidelength(int);//sets default values … |
|
:-/I'm getting the following error when I debug this small test programm . I can't find anything wrong with it. Even on MSDN they come up with a two line sample code which generates that fault code. In other words, they have no clue either. I hope that some one … |
|
Hi, I don't know why the member variable of my class is getting a wrong value. I just want to copy a char array to member variable that is also a char array. What is wrong? Thanks! [CODE]// constructor filewatcher::filewatcher(char filename[]) { // filename to watch strcpy(this->_filename, filename); }[/CODE] |
|
so, iwe been messíng arround with C++ for about 4 days now and here is my first real print all squarenumbers (it will break at a point) : [code]#include <iostream> #include <windows.h> //---------------------------- using namespace std; //---------------------------- int main () { string numbers="1"; bool on = true; do { cout … |
|
Hi, I'm just starting to practice with c++ and I'd like to know if there is a good way to handle the errors/exception. I write this program to check the modification time of a file. Thanks [CODE]int filewatcher::watch() { struct stat filestatus; stat(this->_filename, &filestatus); if((filestatus.st_mode & S_IFMT) == S_IFREG) { … |